-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
153 lines (128 loc) · 4.4 KB
/
build.gradle
File metadata and controls
153 lines (128 loc) · 4.4 KB
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
plugins {
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}
ext {
env = findProperty('env') ?: 'dev'
}
group = 'org.opendatadiscovery'
version = file('VERSION').text
configure([project(':oddrn-generator-java')]) {
apply plugin: 'checkstyle'
apply plugin: 'java-library'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: 'org.opendatadiscovery.internal.plugin.oddrn-generate'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
oddrnGenerate {
mustacheTemplate = file("./mustache/oddrn_path.mustache")
contractPath = file("../oddrn-contract")
outputPath = file("./build/generated-oddrn/src/main/java")
modelPackage = "org.opendatadiscovery.oddrn.model"
}
compileJava.dependsOn oddrnGenerateTask
sourceSets {
main {
java {
srcDirs 'src/main/java'
srcDir "$buildDir/generated-oddrn/src/main/java"
}
}
}
task sourceJar(type: Jar) {
archiveClassifier.set('sources')
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
artifacts {
archives sourceJar, javadocJar
}
dependencies {
compileOnly libs.lombok
annotationProcessor libs.lombok
implementation libs.reflections
testImplementation libs.junit.jupiter.api
testImplementation libs.junit.jupiter.params
testRuntimeOnly libs.junit.jupiter.engine
}
checkstyle {
configFile = project(':').file('config/checkstyle/checkstyle.xml')
configProperties = ["suppressionFile": project(':').file('config/checkstyle/suppressions.xml')]
ignoreFailures = false
maxWarnings = 0
}
test {
useJUnitPlatform()
testLogging.showStandardStreams = true
}
if (env == 'prod') {
signing {
sign(publishing.publications)
}
}
publishing {
if (env == 'prod') {
repositories {
maven {
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}
publications {
maven(MavenPublication) {
groupId = 'org.opendatadiscovery'
artifactId = 'oddrn-generator-java'
version = rootProject.version
from components.java
artifact(sourceJar)
artifact(javadocJar)
pom {
name = 'Java ODDRN Generator'
description = 'OpenDataDiscovery Resource Name generator for Java'
url = 'https://github.com/opendatadiscovery/oddrn-specification'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'gosin'
name = 'German Osin'
organization = 'opendatadiscovery.org'
}
}
scm {
connection = 'scm:git:git://github.com/opendatadiscovery/oddrn-specification.git'
developerConnection = 'scm:git:git://github.com/opendatadiscovery/oddrn-specification.git'
url = 'https://github.com/opendatadiscovery/oddrn-specification'
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
username = sonatypeUsername
password = sonatypePassword
}
}
}
}