forked from salesforce/bazel-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsdk-copybara.sh
executable file
·62 lines (49 loc) · 2.07 KB
/
sdk-copybara.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Bazel Java SDK Vendoring Script
# This script does not actually use copybara, but it is named as such because
# most people will understand the use case. This is a sample script for
# vendoring the SDK into Bazel Eclipse using simple file copy primitives.
# SOURCE
if [ -z "${SDK_DIR+xxx}" ]; then
echo "Please set the location of Bazel Java SDK on your filesystem using the SDK_DIR env variable."
echo " This is the absolute path of the directory that contains the WORKSPACE file of bazel-java-sdk"
exit 1
fi
sdk_root=$SDK_DIR
# DESTINATION
if [ ! -f LICENSE.txt ]; then
echo "This script must be run from the root of the Bazel Eclipse repository."
exit 1
fi
bef_root=$(pwd)
echo "CAUTION! Do you have any uncommitted work in the BEF/BJLS workspace?"
echo "If you do, you need to stash/commit it before continuing, otherwise you will"
echo "lose your work as this script will copy over your BEF files. Continue?"
read HEREWEGO
# SDK
# sdk
# bazel-java-sdk
# aspect/*
# src/main/java/* (aspect, command, index, lang, logging, model, project, workspace)
# src/test/java/**/*Test.java
# bazel-java-sdk-test-framework
# src/main/java/**/test/*.java (mocks)
# BEF
# bundles
# com.salesforce.bazel-java-sdk
# aspect/*
# src/main/java/* (aspect, command, index, lang, logging, model, project, workspace)
# com.salesforce.bazel-java-sdk.testframework
# src/main/java/**/test/* (mocks)
# tests
# com.salesforce.bazel-java-sdk.tests
# src/**/*Test.java
# Mapping Rules
# Aspect
cp -R $sdk_root/sdk/bazel-java-sdk/aspect/* $bef_root/bundles/com.salesforce.bazel-java-sdk/aspect
# SDK Java Classes
cp -R $sdk_root/sdk/bazel-java-sdk/src/main/java/* $bef_root/bundles/com.salesforce.bazel-java-sdk/src/main/java
# Tests for SDK Java Classes
cp -R $sdk_root/sdk/bazel-java-sdk/src/test/java/* $bef_root/tests/com.salesforce.bazel-java-sdk.tests/src
# Test framework that emulates Bazel commands and creates test workspaces
cp -R $sdk_root/sdk/bazel-java-sdk-test-framework/src/main/java/* $bef_root/bundles/com.salesforce.bazel-java-sdk.testframework/src