Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Broke out DB setup tasks into database.gradle.
Upgraded the wrapper to M6.
- Loading branch information
1 parent
e24bf92
commit 404ca04
Showing
6 changed files
with
128 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
apply plugin: 'java' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
runtime 'com.h2database:h2:1.3.153' | ||
} | ||
|
||
|
||
task createDatabaseScript { | ||
group = 'database' | ||
doLast { | ||
def fileName = 'starth2' | ||
if(System.properties['os.name'].startsWith('Windows')) { | ||
fileName += '.bat' | ||
} | ||
def file = new File(projectDir, fileName) | ||
file.withPrintWriter { pw -> | ||
pw.print("java -cp ${sourceSets.main.runtimeClasspath.asPath} org.h2.tools.Server") | ||
} | ||
file.setExecutable(true) | ||
} | ||
} | ||
|
||
task startDatabase(type: JavaExec) { | ||
group = 'database' | ||
workingDir = projectDir | ||
main = 'org.h2.tools.Server' | ||
classpath = runtimeClasspath | ||
} | ||
|
||
task buildSchema(type: JavaExec) { | ||
group = 'workshop' | ||
classpath = runtimeClasspath | ||
workingDir = projectDir | ||
main = 'org.h2.tools.RunScript' | ||
args = ['-url', 'jdbc:h2:db/liquibase_workshop;FILE_LOCK=NO', '-user', 'sa', '-script', 'create-schema-generic.sql'] | ||
} | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Oct 17 09:55:54 MDT 2011 | ||
#Sun Nov 20 13:03:07 MST 2011 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=http\://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-4-bin.zip | ||
distributionUrl=http\://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-6-bin.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters