summaryrefslogtreecommitdiffstats
path: root/recipes-core/ecj
diff options
context:
space:
mode:
authorErkka Kääriä <erkka.kaaria@intel.com>2016-04-29 09:48:19 +0300
committerMaxin B. John <maxin.john@intel.com>2016-04-29 13:17:07 +0300
commit1b975523b8d0467b2e3a44097825c30cdc9e3944 (patch)
treea8b7c140356ed765a6f1455a94fabbf35ad8ec93 /recipes-core/ecj
parent000a7f770faa7312b912937a585185334dec4caf (diff)
downloadmeta-java-1b975523b8d0467b2e3a44097825c30cdc9e3944.tar.gz
java-bootstrapping: Do not rely on hardcoded paths
Various paths to files are hardcoded in either helper scripts or the resulting binaries (like path to Java class libraries). While this works well when using the files on the build machine, things start breaking down when the sstate gets shared between multiple workers in CI, as the paths between workers can differ. Instead of using these hardcoded paths, form the paths at runtime and pass them as parameters when required. Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com> Signed-off-by: Maxin B. John <maxin.john@intel.com>
Diffstat (limited to 'recipes-core/ecj')
-rw-r--r--recipes-core/ecj/ecj-bootstrap-native.bb8
-rw-r--r--recipes-core/ecj/ecj-initial-native.bb9
2 files changed, 15 insertions, 2 deletions
diff --git a/recipes-core/ecj/ecj-bootstrap-native.bb b/recipes-core/ecj/ecj-bootstrap-native.bb
index e159c9d..276a8f0 100644
--- a/recipes-core/ecj/ecj-bootstrap-native.bb
+++ b/recipes-core/ecj/ecj-bootstrap-native.bb
@@ -27,7 +27,13 @@ inherit native
27do_compile() { 27do_compile() {
28 # Create the start script 28 # Create the start script
29 echo "#!/bin/sh" > ecj-bootstrap 29 echo "#!/bin/sh" > ecj-bootstrap
30 echo "ECJ_JAR=${STAGING_DATADIR}/java/${JAR}" >> ecj-bootstrap 30
31 # get absolute path to parent directory, and use that as base path for the jar
32 echo "SH_DIR=\`dirname "\$0"\`" >> ecj-bootstrap
33 echo "CURRENT_DIR=\`cd "\${SH_DIR}" && pwd\`" >> ecj-bootstrap
34 echo "PARENT_DIR=\`dirname \${CURRENT_DIR}\`" >> ecj-bootstrap
35
36 echo "ECJ_JAR=\${PARENT_DIR}/share/java/${JAR}" >> ecj-bootstrap
31 echo "RUNTIME=java" >> ecj-bootstrap 37 echo "RUNTIME=java" >> ecj-bootstrap
32 cat ecj.in >> ecj-bootstrap 38 cat ecj.in >> ecj-bootstrap
33} 39}
diff --git a/recipes-core/ecj/ecj-initial-native.bb b/recipes-core/ecj/ecj-initial-native.bb
index ed334ed..1792390 100644
--- a/recipes-core/ecj/ecj-initial-native.bb
+++ b/recipes-core/ecj/ecj-initial-native.bb
@@ -21,11 +21,18 @@ JAR = "ecj-bootstrap.jar"
21do_compile() { 21do_compile() {
22 # Create the start script 22 # Create the start script
23 echo "#!/bin/sh" > ecj-initial 23 echo "#!/bin/sh" > ecj-initial
24 echo "ECJ_JAR=${STAGING_DATADIR}/java/${JAR}" >> ecj-initial 24
25 # get absolute path to parent directory, and use that as base path for the jar
26 echo "SH_DIR=\`dirname "\$0"\`" >> ecj-initial
27 echo "CURRENT_DIR=\`cd "\${SH_DIR}" && pwd\`" >> ecj-initial
28 echo "PARENT_DIR=\`dirname \${CURRENT_DIR}\`" >> ecj-initial
29
30 echo "ECJ_JAR=\${PARENT_DIR}/share/java/${JAR}" >> ecj-initial
25 echo "RUNTIME=java-initial" >> ecj-initial 31 echo "RUNTIME=java-initial" >> ecj-initial
26 cat ecj-initial.in >> ecj-initial 32 cat ecj-initial.in >> ecj-initial
27} 33}
28 34
35
29do_install() { 36do_install() {
30 install -d ${D}${bindir} 37 install -d ${D}${bindir}
31 install -m 755 ${S}/ecj-initial ${D}${bindir} 38 install -m 755 ${S}/ecj-initial ${D}${bindir}