Skip to content

Commit 6aa8c9c

Browse files
committed
using the gradle built uber jar
1 parent c6c9798 commit 6aa8c9c

15 files changed

Lines changed: 101 additions & 71 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ koans/data*
1111
.settings
1212
koans/app/data
1313
lib/file-compiler/bin
14-
koans/app/config/file_hashes.dat
14+
**/file_hashes.dat
1515
.gradle
1616
*.iml
1717
*.ipr

lib/out/test/lib/com/sandwich/util/io/filecompiler/compilationcommands.properties renamed to koans/app/config/compilationcommands.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.groovy=groovyc -d ${bindir} -classpath ${classpath} ${filename}
2-
.java=javac -d ${bindir} -classpath ${classpath} ${filename}
2+
.java=javac -d ${bindir} -classpath ${classpath} ${filename}
3+

‎koans/app/lib/file-compiler.jar‎

-15.5 KB
Binary file not shown.

‎koans/app/lib/file-monitor.jar‎

-9.77 KB
Binary file not shown.

‎koans/app/lib/koans.jar‎

-3.29 KB
Binary file not shown.

‎koans/app/lib/util.jar‎

-7.49 KB
Binary file not shown.

‎koans/run.bat‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
cls
33
setLocal EnableDelayedExpansion
4-
set CLASSPATH="%~dp0app\bin
4+
set CLASSPATH="%~dp0app\bin;"%~dp0\app\config"
55
for /R "%~dp0\app\lib" %%a in (*.jar) do (
66
set CLASSPATH=!CLASSPATH!;%%a
77
)
@@ -25,4 +25,4 @@ REM cls
2525
@echo javac is not bound to PATH variable.
2626
goto end
2727

28-
:end
28+
:end

‎koans/run.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ buildClasspath()
1414
appDir=$1
1515
classpath=$appDir/bin
1616
IFS=$'\n'
17-
17+
classpath=$classpath:$appDir/config/
1818
for jar in $appDir/lib/*
1919
do
2020
classpath=$classpath:$jar
@@ -26,4 +26,4 @@ java -version > /dev/null 2>&1
2626
exitOnError 'java'
2727
buildClasspath "$DIR"/app
2828
cmd="java -Dapplication.basedir=\"$DIR\" -classpath \"$classpath\" com.sandwich.koan.runner.AppLauncher "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9""
29-
eval $cmd
29+
eval $cmd

‎lib/build.gradle‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,38 @@ dependencies {
1010
testCompile 'junit:junit:4.+'
1111
testCompile 'org.easymock:easymock:3.4'
1212
}
13+
14+
task createJar(type: Jar){
15+
archiveName = 'koans.jar'
16+
manifest {
17+
attributes 'Implementation-Title': 'Java Koans',
18+
'Implementation-Version': 2.0,
19+
'Main-Class': 'com.sandwich.koan.runner.AppLauncher'
20+
}
21+
baseName = "java-koans"
22+
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }}
23+
with jar
24+
}
25+
26+
task copyJarToBin {
27+
doLast {
28+
copy {
29+
from 'build/libs/koans.jar'
30+
into '../koans/app/lib'
31+
}
32+
}
33+
}
34+
35+
test {
36+
37+
classpath = project.sourceSets.test.runtimeClasspath + files("${projectDir}/../koans/app/config")
38+
39+
}
40+
41+
allprojects {
42+
sourceCompatibility = 1.5
43+
targetCompatibility = 1.5
44+
}
45+
46+
task buildApp (dependsOn: [clean, test, createJar, copyJarToBin])
47+

‎lib/out/production/lib/com/sandwich/util/io/filecompiler/compilationcommands.properties‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)