forked from miho/JCSG
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbuild.gradle
More file actions
207 lines (168 loc) · 5.28 KB
/
build.gradle
File metadata and controls
207 lines (168 loc) · 5.28 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
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
201
202
203
204
205
206
207
plugins {
id 'eclipse'
id 'java'
id 'maven-publish'
id 'signing'
id 'com.diffplug.spotless' version '6.25.0'
}
spotless {
java {
lineEndings = com.diffplug.spotless.LineEnding.UNIX
// Eclipse formatter with your config file
eclipse('4.26') // Uses Eclipse's built-in default profile — no XML needed!
// Optional but recommended additions:
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
File buildDir = file(".");
Properties props = new Properties()
props.load(new FileInputStream(buildDir.getAbsolutePath()+"/src/main/resources/com/neuronrobotics/javacad/build.properties"))
group = "com.neuronrobotics"
archivesBaseName = "JavaCad"
version = props."app.version"
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
//apply from: 'http://gradle-plugins.mihosoft.eu/latest/vlicenseheader.gradle'
//repairHeaders.licenseHeaderText = new File(projectDir,'./license-template.txt')
task sourcesJar(type: Jar) {
//classifier = 'sources'
from sourceSets.main.allSource
}
repositories {
mavenCentral()
mavenLocal()
maven { url "https://clojars.org/repo" }
}
// javadoc is way too strict for my taste.
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption("encoding", "UTF-8")
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
//home/hephaestus/.m2/repository/net/jsdia/jsdi_lib/4.5.0-SNAPSHOT/jsdi_lib-4.5.0-SNAPSHOT.pom
//home/hephaestus/.m2/repository/net/jsdai/jsdai_lib/4.5.0-SNAPSHOT/jsdai_lib-4.5.0-SNAPSHOT.pom
//home/hephaestus/.m2/repository/net/jsdia/jsdai_lib/4.5.0-SNAPSHOT/jsdai_lib-4.5.0-SNAPSHOT.pom
task javadocJar(type: Jar, dependsOn: javadoc) {
//classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.0'
implementation 'commons-io:commons-io:2.7'
implementation group:'com.googlecode.json-simple', name:'json-simple', version:'1.1'
implementation 'com.google.code.gson:gson:2.8.9'
implementation group: 'eu.mihosoft.vvecmath', name: 'vvecmath', version: '0.4.0'
implementation group: 'javax.vecmath', name: 'vecmath', version: '1.5.2'
implementation 'org.slf4j:slf4j-simple:1.6.1'
implementation group: 'org.apache.xmlgraphics', name: 'batik-all', version: '1.17'
implementation fileTree (dir: 'libs', includes: ['kabeja*.jar'])
// triangulation algorithm
implementation group: 'org.locationtech.jts', name: 'jts-core', version: '1.20.0'// https://mvnrepository.com/artifact/org.orbisgis/poly2tri
//implementation group: 'org.orbisgis', name: 'poly2tri', version: '0.7.0'
// alternate triangulation
//implementation "io.github.earcut4j:earcut4j:2.2.2"
// alt 3 for triangulation
//implementation group: 'com.github.jdiemke.delaunay-triangulator', name: 'DelaunayTriangulator', version: 'v1.0.0'
implementation 'com.google.code.gson:gson:2.5'
implementation 'com.aparapi:aparapi:3.0.2'
//SSL for server
implementation 'org.bouncycastle:bcprov-jdk18on:1.80'
implementation 'org.bouncycastle:bcpkix-jdk18on:1.80'
//manifold 3d
implementation("com.github.madhephaestus:manifold3d:v3.4.1-15")
}
Date buildTimeAndDate = new Date()
ext {
buildDate = new java.text.SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new java.text.SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += ['--enable-preview']
}
tasks.withType(Test).configureEach {
jvmArgs '--enable-preview'
}
tasks.withType(JavaExec).configureEach {
jvmArgs '--enable-preview'
}
test {
dependsOn 'spotlessApply'
testLogging {
// Show which test is running
events "passed", "skipped", "failed", "standardOut", "standardError"
// Show standard out and error
showStandardStreams = true
// Optional: show more details
exceptionFormat = "full"
showExceptions = true
showCauses = true
showStackTraces = true
}
}
publishing {
repositories {
maven {
name = "OSSRH"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name= 'JCSG'
packaging ='jar'
// optionally artifactId can be defined here
description ='A Java based CSG Cad library'
url= 'https://github.com/NeuronRobotics/JCSG'
scm {
connection ='scm:git:https://github.com/NeuronRobotics/JCSG'
developerConnection ='scm:git:https://github.com/NeuronRobotics/JCSG'
url ='https://github.com/NeuronRobotics/JCSG'
}
licenses {
license {
name= 'The Apache License, Version 2.0'
url ='http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id ='madhephaestus'
name= 'Kevin Harrington'
email= 'kharrington@neuronrobotics.com'
}
}
}
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
signing {
sign publishing.publications.mavenJava
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}