-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.gradle
194 lines (132 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
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
// https://central.sonatype.org/publish/publish-gradle/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0"
//classpath 'com.github.rholder:gradle-one-jar:1.0.4'
}
}
apply plugin: 'io.codearte.nexus-staging'
allprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'java-library'
}
version = '4.1.14'
group = 'com.jpaulmorrison'
description = 'Java implementation of Flow-Based Programming (FBP)'
compileJava.options.encoding = 'UTF-8'
//sourceCompatibility = JavaVersion.VERSION_1_8
//targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = 1.8
targetCompatibility = 1.8
mainClassName = 'com.jpaulmorrison.fbp.core.engine.DummyMain'
ossrhUser = project.hasProperty('ossrhUser') ? project.property('ossrhUser') : ""
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ""
nexusStaging {
username = ossrhUser
password = ossrhPassword
}
repositories {
mavenCentral()
}
dependencies {
compileOnly 'com.google.code.gson:gson:2.11.0'
// compileOnly 'mysql:mysql-connector-java:8.0.22'
}
java {
withSourcesJar()
withJavadocJar()
}
jar {
manifest {
attributes ('Implementation-Title': 'JavaFBP', 'Implementation-Version': project.version,
'Class-Path': configurations.compileClasspath.collect { it.getName() }.join(' '),
'Main-Class' : mainClassName)
}
//baseName = project.name + '-all'
archiveBaseName = project.name
from sourceSets.main.output
}
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addBooleanOption('Xdoclint:none', true)
}
}
ext {
snapshotPublicationRepository = "https://oss.sonatype.org/content/repositories/snapshots/"
releasePublicationRepository = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
//ossrhUser = project.hasProperty('ossrhUser') ? project.property('ossrhUser') : ""
//ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ""
}
// Used to generate initial maven-dir layout
task "create-dirs" {
doLast {
description = "Create default maven directory structure"
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'com.jpaulmorrison'
artifactId = 'javafbp'
version = project.version
from components.java
pom {
name = 'JavaFBP'
description = 'Java implementation of Flow-Based Programming'
// groupId 'com.jpaulmorrison'
packaging 'jar'
url = 'https://github.com/jpaulm/javafbp'
licenses {
license {
name = 'Clarified Artistic License'
url = 'https://spdx.org/licenses/ClArtistic.html'
}
}
developers {
developer {
id = 'jpaulmorr'
name = 'John Paul Rodker Morrison (Software architect/developer)'
email = 'jpaulmorr@gmail.com'
}
}
scm {
connection = 'scm:git:git:https://github.com/jpaulm.git'
developerConnection = 'scm:git:ssh:https://github.com/jpaulm.git'
url = 'https://github.com/jpaulm.git'
}
}
}
}
repositories {
maven {
url (version.endsWith('SNAPSHOT') ? snapshotPublicationRepository : releasePublicationRepository)
credentials {
username = ossrhUser
password = ossrhPassword
}
}
}
signing {
required {
// signing is required if this is a release version and the artifacts are to be published
!version.toString().endsWith('-SNAPSHOT') && tasks.withType(PublishToMavenRepository).find {
gradle.taskGraph.hasTask it
}
}
sign publishing.publications
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
}