-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
183 lines (152 loc) · 4.47 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
buildscript {
ext {
uptodateVersion = "1.6.2"
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.ofg:uptodate-gradle-plugin:1.6.3"
classpath "net.ltgt.gradle:gradle-apt-plugin:0.15"
classpath "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.6.2"
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.10.0"
}
wrapper {
gradleVersion = "4.6"
}
}
apply plugin: "net.ltgt.apt"
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "com.ofg.uptodate"
apply plugin: "license"
apply plugin: "com.diffplug.gradle.spotless"
apply plugin: "com.jfrog.artifactory"
apply plugin: "maven"
apply plugin: "osgi"
apply from: "$rootDir/lib.gradle"
defaultTasks 'build'
ext {
isSnapshot = true
d4jFJBaseVersion = "0.2"
snapshotAppendix = "-SNAPSHOT"
d4jFJVersion = d4jFJBaseVersion + (isSnapshot ? snapshotAppendix : "")
projectTitle = "Derive4J - Auto derivation for Functional Java"
projectName = "derive4j-fj"
pomProjectName = projectTitle
pomOrganisation = "Derive4J contributors"
projectDescription = "Derivation of Functional-Java optics and typeclasses via Derive4J API"
projectUrl = "https://github.com/derive4j/derive4j-fj"
scmUrl = "git://github.com/derive4j/derive4j-fj.git"
scmGitFile = "scm:[email protected]:derive4j/derive4j-fj.git"
primaryEmail = "[email protected]"
dependencyAutoService = "com.google.auto.service:auto-service:1.0-rc4"
}
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
compileOnly "org.derive4j:derive4j-processor-api:0.12.4"
compileOnly dependencyAutoService
apt dependencyAutoService
}
archivesBaseName = projectName
version = d4jFJVersion
group = "org.derive4j"
sourceCompatibility = "1.8"
task javadocJar(type: Jar, dependsOn: "javadoc") {
classifier = 'javadoc'
from "build/docs/javadoc"
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
tasks.withType(JavaCompile) {
options.compilerArgs += ["-Xlint:all"]
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
jar {
version project.d4jFJVersion
manifest {
name = projectTitle
instruction 'Signature-Version', project.d4jFJVersion
instruction 'Bundle-ActivationPolicy', 'lazy'
instruction 'Bundle-Vendor', 'derive4j.org'
if(project.name != "processor") {
instruction 'Require-Bundle', 'org.derive4j.fj;bundle-version="'+project.d4jFJBaseVersion+'"'
}
}
}
eclipse {
project {
natures 'org.eclipse.pde.PluginNature'
buildCommand 'org.eclipse.pde.ManifestBuilder'
buildCommand 'org.eclipse.pde.SchemaBuilder'
}
}
// Output MANIFEST.MF statically so eclipse can see it for plugin development
task eclipsePluginManifest(dependsOn: jar) doLast {
file("META-INF").mkdirs()
jar.manifest.writeTo(file("META-INF/MANIFEST.MF"))
}
eclipseProject.dependsOn eclipsePluginManifest
artifactoryPublish {
dependsOn sourcesJar, javadocJar
}
spotless {
java {
eclipse("4.7.2").configFile "$rootDir/etc/eclipse-format.xml"
indentWithSpaces(2)
trimTrailingWhitespace()
removeUnusedImports()
endWithNewline()
}
}
license {
header project.file('etc/HEADER.txt')
strictCheck true
mapping {
java = 'SLASHSTAR_STYLE'
}
}
configureUpload("The GNU General Public License")
artifactory {
contextUrl = 'http://oss.jfrog.org/artifactory' //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
// The Artifactory repository key to publish to :
if (isSnapshot) {
repoKey = 'oss-snapshot-local'
} else {
repoKey = 'oss-release-local'
}
username = jfrogUsername //The publisher user name
password = jfrogPassword //The publisher password
}
defaults {
publishConfigs('archives')
}
}
resolve {
repository {
repoKey = 'libs-releases' //The Artifactory (preferably virtual) repository key to resolve from
}
}
}
task env doLast {
println System.getenv()
}