This repository has been archived by the owner on Dec 20, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
148 lines (124 loc) · 4.71 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
* This build file was auto generated by running the Gradle 'init' task
* by 'hpitelka' at '10/12/16 1:16 PM' with Gradle 2.10
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/2.10/userguide/tutorial_java_projects.html
*/
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: 'org.kordamp.markdown.convert'
apply from: 'localSettings.gradle'
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
}
// In this section you declare the dependencies for your production and test code
dependencies {
// The production code uses the SLF4J logging API at compile time
compile group: 'io.dropwizard', name: 'dropwizard-core', version: '1.0.2'
compile group: 'io.dropwizard', name: 'dropwizard-jdbi', version: '1.0.2'
compile group: 'io.dropwizard', name: 'dropwizard-migrations', version: '1.0.2'
compile group: 'io.dropwizard', name: 'dropwizard-auth', version: '1.0.2'
compile group: 'io.dropwizard', name: 'dropwizard-views-freemarker', version: '1.0.2'
compile group: 'io.dropwizard', name: 'dropwizard-assets', version: '1.0.2'
compile 'org.xerial:sqlite-jdbc:3.14.2.1' //If using SQLite
compile 'javax.mail:mail:1.4.7'
compile 'ch.qos.logback:logback-classic:1.2.3'
compile 'ch.qos.logback:logback-core:1.2.3'
compile 'ch.qos.logback:logback-access:1.2.3'
compile 'com.github.waffle:waffle-distro:1.8.3'
compile 'com.graphql-java:graphql-java:2.2.0'
compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20160924.1'
compile group: 'org.jvnet.com4j', name: 'com4j', version: '20110320'
compile 'org.jvnet.com4j.typelibs:active-directory:1.0'
compile 'org.jvnet.com4j.typelibs:ado20:1.0'
compile files('lib/sqljdbc42.jar')
testCompile group: 'io.dropwizard', name: 'dropwizard-testing', version: '1.0.2'
testCompile group: 'io.dropwizard', name: 'dropwizard-client', version: '1.0.2'
testCompile 'org.apache.commons:commons-io:1.3.2'
}
//Set project version to git tag
def proc = "git describe".execute(null, projectDir);
proc.waitFor();
project.version = proc.text.trim();
mainClassName = "mil.dds.anet.AnetApplication"
applicationDefaultJvmArgs = ["-Djava.library.path=MY_APP_HOME/lib"]
String dbDriver = run.environment['DB_DRIVER']
dbDriver = dbDriver ? dbDriver : "sqlite"
if (dbDriver == "sqlserver") {
run.environment("ANET_DB_DRIVER", "com.microsoft.sqlserver.jdbc.SQLServerDriver")
run.environment("ANET_DB_URL", "jdbc:sqlserver://${run.environment['ANET_DB_SERVER']};databaseName=${run.environment['ANET_DB_NAME']}")
} else {
run.environment("ANET_DB_DRIVER", "org.sqlite.JDBC")
run.environment("ANET_DB_URL", "jdbc:sqlite:development.db")
run.environment("ANET_DB_DATE_STRING_FORMAT", "yyyy-MM-dd hh:mm:ss.SSS Z")
run.environment("ANET_DB_DATE_CLASS", "text")
}
test.environment = run.environment
run.args = ["server","anet.yml"]
task dbStatus(dependsOn: 'compileJava', type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
environment(run.environment)
main = 'mil.dds.anet.AnetApplication'
args = ["db","status","anet.yml"]
}
task dbMigrate(dependsOn: 'compileJava', type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
environment(run.environment)
main = 'mil.dds.anet.AnetApplication'
args = ["db","migrate","anet.yml"]
}
task dbDrop(dependsOn: 'compileJava', type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
environment(run.environment)
main = 'mil.dds.anet.AnetApplication'
args = ["db","drop-all","--confirm-delete-everything","anet.yml"]
}
//Configure the Java Checkstyle settings. Run with ./gradlew check
checkstyle {
configFile = rootProject.file('gradle/checkstyle.xml')
toolVersion = '7.5'
}
//Configure extra files to include the distribution file
distributions {
main {
contents {
into('docs/') {
from('anet.yml') { rename('anet.yml', 'anet.yml.template') }
from(markdownToHtml)
}
into('lib/') {
from('lib/sqljdbc_auth.dll')
}
}
}
}
//Add gradle plugin repos
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.kordamp:markdown-gradle-plugin:1.1.0"
}
}
startScripts {
doLast {
unixScript.text = unixScript.text.replace('MY_APP_HOME', '\$APP_HOME')
windowsScript.text = windowsScript.text.replace('MY_APP_HOME', '%APP_HOME%')
}
}
//Configure Markdown plugin
allprojects {
markdownToHtml.sourceDir = file("docs")
markdownToHtml.outputDir = file("$buildDir/documentation")
markdownToHtml.hardwraps = true
}