-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
156 lines (135 loc) · 4.36 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
148
149
150
151
152
153
154
155
156
plugins {
id "com.jfrog.bintray" version "1.7.3"
}
group 'onethreeseven'
version '0.0.4-SNAPSHOT'
allprojects {
repositories {
jcenter()
mavenCentral()
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'idea'
}
repositories {
mavenLocal()
mavenCentral()
//maven{url 'https://dl.bintray.com/lukehb/137-common'} //common module hosted on bintray
maven{url 'https://dl.bintray.com/lukehb/137-geo'} //geography module hosted on bintray
maven{url 'https://dl.bintray.com/lukehb/137-jclimod'} //cli module hosted on bintray
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
//to make this a plugin of trajsuite
compile (group: 'onethreeseven', name: 'trajsuitePlugin', version: '0.0.1-SNAPSHOT') {force = true}
compile group: 'onethreeseven', name: 'geo', version: '0.0.4'
compile group: 'onethreeseven', name: 'common', version: '0.0.5-SNAPSHOT'
compile (group: 'onethreeseven', name: 'jclimod', version: '0.0.1-SNAPSHOT') {force = true}
}
ext.moduleName = 'onethreeseven.datastructures'
mainClassName = 'onethreeseven.datastructures.Main'
compileJava {
println classpath.asPath
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
}
compileTestJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'junit',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath,
]
classpath = files()
}
}
test {
inputs.property("moduleName", moduleName)
doFirst {
jvmArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'ALL-MODULE-PATH',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.outputDir).asPath,
]
classpath = files()
}
}
jar {
inputs.property("moduleName", moduleName)
manifest {
attributes(
'Main-Class': mainClassName,
'Automatic-Module-Name': moduleName,
"Implementation-Title": project.name,
"Implementation-Version": version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'))
}
}
jar.dependsOn(test)
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc{
options.addStringOption('-module-path', classpath.asPath)
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from 'build/docs/javadoc'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
groupId group
artifactId project.name
version version
artifact sourcesJar
artifact javadocJar
}
}
}
idea {
module {
inheritOutputDirs = true
downloadJavadoc = true
downloadSources = true
}
}
bintray {
user = project.hasProperty('bintrayUser') ? project.bintrayUser : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayKey') ? project.bintrayKey : System.getenv('BINTRAY_KEY')
publications = ['MyPublication']
publish = true //If version should be auto published after an upload
pkg {
repo = '137-datastructures'
name = '137-datastructures'
licenses = ['MIT']
desc = 'Data structures used for building applications, particularly data-mining projects.'
websiteUrl = 'https://github.com/lukehb/137-datastructures'
issueTrackerUrl = 'https://github.com/lukehb/137-datastructures/issues'
vcsUrl = 'https://github.com/lukehb/137-datastructures.git'
labels = ['137', 'java', 'data-mining', 'data-structures']
publicDownloadNumbers = true
githubRepo = 'lukehb/137-datastructures'
githubReleaseNotesFile = 'README.md'
}
}