Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the tools.jar location to be taken from the SDK #140

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stf.build/include/top.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ limitations under the License.
<pathelement location="${first_prereqs_root}/log4j/log4j-core.jar"/>
</path>
<path id="tools.class.path">
<pathelement location="${first_prereqs_root}/tools/tools.jar"/>
<pathelement location="${java.home}/../lib/tools.jar"/>
</path>
<path id="asm.class.path">
<pathelement location="${first_prereqs_root}/asm/asm.jar"/>
Expand Down Expand Up @@ -332,9 +332,9 @@ limitations under the License.
-->

<target name="configure-tools-jar" depends="setup-java-properties" unless="${tools_jar_correct}">
<property name="tools_jar_origin" value="${java_bindir}/../lib/tools.jar"/>
<property name="tools_jar_origin" value="${java.home}/../lib/tools.jar"/>
<echo message="configure-tools-jar: Copying ${tools_jar_origin} to ${tools_jar_dir}"/>
<copy file="${tools_jar_origin}" todir="${tools_jar_dir}"/>
<copy file="${tools_jar_origin}" todir="${tools_jar_dir}"/>
<property name="tools_jar" value="${tools_jar_dir}/${tools_jar_file}"/>
<available file="${tools_jar_dir}/${tools_jar_file}" property="tools_jar_correct"/>
</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ public StfEnvironmentCore(ArrayList<PropertyFileDetails> propertyFileDetails, Ar
this.testRoots.add(defaultTestRoot);
invocationProperties.put(Stf.ARG_TEST_ROOT.getName(), defaultTestRoot.getSpec());
}

try {
String javaHome = System.getProperty("java.home");
File javaLibDir = new File(javaHome, "../lib");
if (javaLibDir.exists() && javaLibDir.isDirectory()) {
this.testRoots.add(new DirectoryRef(javaLibDir.getCanonicalPath()));
} else {
System.out.println("Java lib directory does not exist: " + javaLibDir.getCanonicalPath());
}
} catch (IOException e) {
throw new RuntimeException("Failed to add Java lib directory to test roots", e);
}

// Work out where the prereqs are
if (!getProperty(Stf.ARG_SYSTEMTEST_PREREQS).isEmpty()) {
Expand Down