-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
91 lines (82 loc) · 2.12 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
* Copyright (c) 2012, Inversoft, All Rights Reserved.
*/
// Project info
group = "com.inversoft.libraries"
version = "0.1"
description = "The MyBatis Generator Project"
// Plugins
apply plugin: "java"
apply plugin: "idea"
apply plugin: "init"
apply plugin: "database"
apply plugin: "release"
releasePlugin.publicRepo = false
// Build script config
buildscript {
repositories {
ivy {
name "inversoftPublic"
ivyPattern "http://hawking.inversoft.com/repository/public/[organisation]/[module]/[revision]/ivy.xml"
artifactPattern "http://hawking.inversoft.com/repository/public/[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]"
}
ivy {
url "${project.gradle.gradleUserHomeDir}/integration-cache"
}
}
dependencies {
classpath(
"org.primeframework.gradle:gradle-init-plugin:0.4",
"org.primeframework.gradle:gradle-database-plugin:0.3",
"org.primeframework.gradle:gradle-release-plugin:0.11"
)
}
}
dependencies {
compile(
"commons-cli:commons-cli:1.2",
"mysql:mysql-connector-java:5.1.18",
"org.apache.commons:commons-lang3:3.1",
"org.freemarker:freemarker:2.3.19",
"postgresql:postgresql:9.1-901-1.jdbc4"
)
testCompile(
"org.easymock:easymock:3.1",
"org.testng:testng:6.8"
)
}
// Database build steps
//database.types = [database.mysql, database.postgresql]
database.types = [database.mysql]
createDatabaseTest.doLast {
println "Seeding databases: ${database.types}"
database.types.each { dbType ->
database.executeSQLFile(dbType, database.testName, "src/test/db/${dbType}.sql", "dev", "dev", true, true);
}
}
// Java config
sourceCompatibility = 1.6
jar.doLast {
copy {
from "src/main/script"
into "${project.distsDir}/bin"
}
copy {
from "src/main/templates"
into "${project.distsDir}/templates"
}
copy {
from "${project.libsDir}"
into "${project.distsDir}/lib"
}
copy {
from configurations.runtime
into "${project.distsDir}/lib"
}
ant.chmod(perm: "+x", file: "${project.distsDir}/bin/mybatis-generator")
}
// Testing
test {
dependsOn "createDatabaseTest"
useTestNG()
}