forked from riy/degraph
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
200 lines (153 loc) · 6.32 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
buildscript {
repositories {
maven { url "https://github.com/ben-manes/gradle-versions-plugin/raw/mvnrepo" }
mavenCentral()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.5-beta-5'
classpath 'net.nisgits.gradle:gradle-executable-jar-plugin:1.7.0' // executable jar plugin
}
}
try { // fails when there is no network available
apply from: 'http://tellurianring.com/projects/gradle-plugins/gradle-release/1.1/apply.groovy'
createReleaseTag.dependsOn(':degraph:pushToBintray')
createReleaseTag.dependsOn(':core:pushToBintray')
createReleaseTag.dependsOn(':check:pushToBintray')
} catch (RuntimeException re) {
System.out.println("releasing not possible (probably no network)")
re.printStackTrace()
}
allprojects {
apply plugin: 'scala'
apply plugin: 'idea'
apply plugin: 'maven'
if (hasProperty('ossrhUsername'))
apply plugin: 'signing'
apply plugin: 'versions'
group = "de.schauderhaft.degraph"
task wrapper(type: Wrapper) {
gradleVersion = '2.1'
}
}
subprojects {
targetCompatibility = 1.7
sourceCompatibility = 1.7
tasks.withType(ScalaCompile) {
scalaCompileOptions.useAnt = false
}
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.11'
testCompile 'org.scalatest:scalatest_2.10:2.2.0'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from scaladoc
}
javadocJar.dependsOn scaladoc
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
if (hasProperty('ossrhUsername'))
signing {
sign configurations.archives
}
if (hasProperty('ossrhUsername'))
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Degraph'
packaging 'jar'
// optionally artifactId can be defined here
description 'Degraph is a library for producing jvm package dependency graphs for visual inspection ' +
'as well as writing tests for checking properties of the dependencies.'
url 'http://schauder.github.io/degraph/'
scm {
connection 'scm:git:https://github.com/schauder/degraph.git'
developerConnection 'scm:git:https://github.com/schauder/degraph.git'
url 'https://github.com/schauder/degraph.git'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'schauder'
name 'Jens Schauder'
email '[email protected]'
}
}
}
}
}
}
}
project('core') {
description = 'Degraph is a library for producing jvm package dependency graphs for visual inspection ' +
'as well as writing tests for checking properties of the dependencies. The core module makes up' +
' the main logic of Degraph independent of any UI.'
archivesBaseName = "degraph-core"
createBintrayTasks(project.name, version, "install")
dependencies {
compile 'org.scala-lang:scala-library:2.10.4'
compile 'org.ow2.asm:asm:5.0.3'
compile 'com.assembla.scala-incubator:graph-core_2.10:1.9.0'
}
}
private void createBintrayTasks(String projectName, projectVersion, String dependsOn) {
if (hasProperty('bintrayApiKey')) {
task pushToBintray(type: Exec) {
commandLine 'curl', '-T', 'build/libs/degraph-' + projectName + '-' + projectVersion + '.jar', '-uschauder:' + bintrayApikey, 'https://api.bintray.com/content/schauder/schauderhaft-de/Degraph/' + projectVersion + '/degraph-' + projectName + '-' + projectVersion + '.jar'
}
pushToBintray.dependsOn(dependsOn)
}
}
project('check') {
description = 'Degraph is a library for producing jvm package dependency graphs for visual inspection ' +
'as well as writing tests for checking properties of the dependencies.' +
' The check module allows to write unit tests using scalatest, or junit'
archivesBaseName = "degraph-check"
createBintrayTasks(project.name, version, "install")
dependencies {
compile project(':core')
compile 'org.scalatest:scalatest_2.10:2.2.0'
compile 'org.hamcrest:hamcrest-all:1.3'
}
}
project('degraph') {
apply plugin: 'application'
description = 'Degraph is a library for producing jvm package dependency graphs for visual inspection ' +
'as well as writing tests for checking properties of the dependencies.' +
' The depgraph module is a command line application for creating dependency graphs.'
mainClassName = 'de.schauderhaft.degraph.app.Degraph'
applicationDistribution.from(['license.txt', 'readme.markdown', 'releaseNotes.md']) {
into "/"
}
applicationDistribution.from('src/demo/resource') {
into "/example/"
}
createBintrayTasks(project.name, version, "distZip")
distZip.dependsOn scaladoc
dependencies {
compile project(':core')
compile 'org.rogach:scallop_2.10:0.9.5'
compile 'org.rogach:scallop_2.10:0.9.5'
}
}