Permalink
Browse files

Fix classpath issue for adapter by adding reference paths to tools li…

…b dir

- for both source distribution and binary distribution
  • Loading branch information...
1 parent 850818c commit 37ad07cf732ae3d13dc543e598df9c54346c802f @matthieumorel matthieumorel committed Jul 26, 2012
View
@@ -57,6 +57,8 @@
</li>
<li>[<a href='https://issues.apache.org/jira/browse/S4-87'>S4-87</a>] - Checkpointing: recovery : avoid rejections upon fetching
</li>
+<li>[<a href='https://issues.apache.org/jira/browse/S4-89'>S4-89</a>] - Fix references to S4 libs when resolving classpath for adapter in new S4 application
+</li>
</ul>
<h2> Improvement
@@ -115,4 +117,3 @@
<li>[<a href='https://issues.apache.org/jira/browse/S4-88'>S4-88</a>] - Prepare 0.5.0 release
</li>
</ul>
-
@@ -63,8 +63,10 @@ public static void main(String[] args) {
new File(appArgs.getAppDir() + "/gradlew").setExecutable(true);
// copy build file contents
- Files.copy(Resources.newInputStreamSupplier(Resources.getResource("templates/build.gradle")), new File(
- appArgs.getAppDir() + "/build.gradle"));
+ String buildFileContents = Resources.toString(Resources.getResource("templates/build.gradle"),Charsets.UTF_8);
+ buildFileContents = buildFileContents.replace("<s4_install_dir>", "'"+new File(appArgs.s4ScriptPath).getParent()+"'");
+ Files.write(buildFileContents, new File(
+ appArgs.getAppDir() + "/build.gradle"), Charsets.UTF_8);
// update app settings
String settingsFileContents = Resources.toString(Resources.getResource("templates/settings.gradle"),
@@ -158,7 +158,7 @@ s4r << {
task cp << {
description='Dumps the classpath for running a class from this project, into a \'classpath.txt\' file in the current directory'
- new File("classpath.txt").write(sourceSets.main.runtimeClasspath.asPath)
+ new File("classpath.txt").write(sourceSets.main.output.classesDir.path + File.pathSeparator + <s4_install_dir> + '/lib/*' + File.pathSeparator + <s4_install_dir> + '/subprojects/s4-tools/build/install/s4-tools/lib/*')
}
/* Install the S4 archive to the install directory. */

0 comments on commit 37ad07c

Please sign in to comment.