-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
151 lines (125 loc) · 3.81 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
import aQute.bnd.osgi.Processor
buildscript {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
plugins {
id 'biz.aQute.bnd.builder' version "6.1.0"
id "org.jdrupes.mdoclet" version "1.0.3"
id 'org.ajoberstar.grgit' version '4.1.0'
id 'org.ajoberstar.git-publish' version '3.0.0'
}
repositories {
jcenter()
mavenCentral()
}
apply plugin: 'java-library'
apply plugin: 'biz.aQute.bnd.builder'
apply plugin: 'signing'
apply plugin: 'maven-publish'
// Makes Eclipse-groovy handle *.gradle file properly
apply plugin:'groovy'
group = 'org.jdrupes.json'
archivesBaseName = 'json'
description = "JDrupes JSON library"
ext.releaseVersion = "2.3.1"
ext.isSnapshot = false
version = releaseVersion + (isSnapshot ? "-SNAPSHOT" : "")
// Derive bundle version and propagate to bnd
def bundleVersion = releaseVersion +
(isSnapshot ? ".-\${tstamp}-SNAPSHOT" : ".rel")
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
jar {
manifest {
// Used by bnd to calculate "Bundle-Version" header
attributes('bundleVersion': bundleVersion)
}
}
test {
useJUnitPlatform()
}
dependencies {
api 'com.fasterxml.jackson.core:jackson-core:2.12.2'
implementation 'org.osgi:org.osgi.annotation:6.0.0'
testImplementation "org.codehaus.groovy:groovy-all:3.0.9"
testImplementation "org.spockframework:spock-core:2.0-M5-groovy-3.0"
// Use gradle mechanims to get the artifact to baseline against.
// We baseline against the previous release (latest excluding current)
baseline("${group}:${archivesBaseName}:(,${releaseVersion})") {
transitive false
}
}
// Configure sensible layout
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'resources'
}
}
test {
java {
srcDir 'test'
}
groovy {
srcDir 'test'
}
resources {
srcDir 'resources'
}
}
}
jar {
manifest {
attributes('Bundle-Version': version)
}
}
configurations {
markdownDoclet
javadocTaglets
}
dependencies {
markdownDoclet "org.jdrupes.mdoclet:doclet:2.0.0"
javadocTaglets "org.jdrupes.taglets:plantuml-taglet:2.0.0"
}
task java11doc(type: JavaExec) {
enabled = JavaVersion.current().isJava11()
dependsOn classes
inputs.file "overview.md"
jvmArgs = ['--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED']
classpath sourceSets.main.compileClasspath
classpath files(tasks.jar)
ext.destinationDir = file("../org.jdrupes.json.gh-pages/javadoc")
main = 'jdk.javadoc.internal.tool.Main'
args = ['-doctitle', 'JDrupes JSON library',
'-use',
'-linksource',
'-link', 'https://docs.oracle.com/en/java/javase/11/docs/api/',
'--add-exports', 'jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED',
'-doclet', 'org.jdrupes.mdoclet.MDoclet',
'-docletpath', configurations.markdownDoclet.files.asType(List).join(":"),
'--disable-auto-highlight',
'-tagletpath', configurations.javadocTaglets.files.asType(List).join(":"),
'-taglet', 'org.jdrupes.taglets.plantUml.PlantUml',
'-taglet', 'org.jdrupes.taglets.plantUml.StartUml',
'-taglet', 'org.jdrupes.taglets.plantUml.EndUml',
'-overview', 'overview.md',
'-d', destinationDir,
'-sourcepath', 'src/',
'-subpackages', 'org.jdrupes.json',
'-bottom', file("misc/javadoc.bottom.txt").text,
'--allow-script-in-comments',
'-Xdoclint:-html',
'--add-exports=jdk.javadoc/jdk.javadoc.internal.doclets.formats.html=ALL-UNNAMED'
]
ignoreExitValue true
}
apply from: "${project.rootDir}/gradle/publishing.gradle"
apply from: "${project.rootDir}/gradle/eclipse.gradle"