This repository has been archived by the owner on Jun 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
240 lines (211 loc) · 8.29 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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.library' version '7.3.1' apply false
}
subprojects {
apply plugin: 'signing'
apply plugin: 'maven-publish'
ext {
libraryName = 'Notcute'
libraryGroupName = 'io.notcute'
libraryPublishGroupName = 'io.github.notcute'
libraryDescription = 'Cross-platform direct UI Toolkit for Java. Currently supports Windows/Linux/macOS/Android.'
libraryUrl = 'https://github.com/notcute/notcute'
libraryVersionCode = 1
libraryVersionName = '0.1.0-SNAPSHOT'
libraryCoreSourceCompatibility = JavaVersion.VERSION_1_8
libraryCoreTargetCompatibility = JavaVersion.VERSION_1_8
libraryLicenseName = 'The Apache License, Version 2.0'
libraryLicenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
libraryScmConnection = 'scm:git:git@github.com/notcute/notcute.git'
libraryScmDeveloperConnection = libraryScmConnection
libraryScmUrl = libraryUrl
libraryAndroidCompileSdk = 33
libraryAndroidMinSdk = 16
libraryAndroidTargetSdk = 33
libraryAndroidSourceCompatibility = JavaVersion.VERSION_1_8
libraryAndroidTargetCompatibility = JavaVersion.VERSION_1_8
libraryJavaSESourceCompatibility = JavaVersion.VERSION_1_8
libraryJavaSETargetCompatibility = JavaVersion.VERSION_1_8
}
group libraryGroupName
version libraryVersionCode
}
configure ([project(':core'), project(':signalslot'), project(':collections'), project('geom2d'), project('g2d-core'),
project(':ui-core'), project(':commons'), project(':audio-core'), project(':widgets')]) {
apply plugin: 'java-library'
sourceCompatibility = libraryCoreSourceCompatibility
targetCompatibility = libraryCoreTargetCompatibility
}
configure ([project(':desktop'), project(':g2d-awt'), project(':ui-awt'), project(':javase'),
project(':audio-javase'), project(':g2d-swt'), project(':ui-swt'), project(':ui-swing')]) {
apply plugin: 'java-library'
sourceCompatibility = libraryJavaSESourceCompatibility
targetCompatibility = libraryJavaSETargetCompatibility
}
// Java projects
configure ([project(':core'), project(':signalslot'), project(':collections'), project('geom2d'), project('g2d-core'),
project(':g2d-awt'), project(':ui-core'), project(':ui-awt'), project(':javase'), project(':commons'), project(':audio-core'), project(':audio-javase'),
project(':widgets'), project(':g2d-swt'), project(':ui-swt')]) {
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
test {
useJUnitPlatform()
}
// publish
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = libraryGroupName
artifactId = "${rootProject.name}-${project.name}"
version = libraryVersionName
from components.java
pom {
name = libraryPublishGroupName
description = libraryDescription
url = libraryUrl
licenses {
license {
name = libraryLicenseName
url = libraryLicenseUrl
}
}
developers {
developer {
id = 'Tianscar'
name = 'Tiansword Carbonicacid'
email = 'tianscar@protonmail.com'
}
}
scm {
connection = libraryScmConnection
developerConnection = libraryScmDeveloperConnection
url = libraryScmUrl
}
}
}
}
repositories {
maven {
name = "OSSRH"
if (project.version.toString().endsWith("-SNAPSHOT")) {
url = "https://s01.oss.sonatype.org/content/repositories/snapshots"
} else {
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
}
signing {
sign(publishing.publications.mavenJava)
}
}
// Android projects
configure ([project(':android'), project(':g2d-android'), project(':ui-android'), project(':audio-android')]) {
apply plugin: 'com.android.library'
android {
namespace libraryGroupName + '.' + project.name.replaceAll('-', '.')
compileSdk libraryAndroidCompileSdk
defaultConfig {
minSdk libraryAndroidMinSdk
targetSdk libraryAndroidTargetSdk
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
//multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility libraryAndroidSourceCompatibility
targetCompatibility libraryAndroidTargetCompatibility
//coreLibraryDesugaringEnabled true
}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
//coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}
// publish
android {
publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}
}
publishing {
publications {
release(MavenPublication) {
groupId = libraryGroupName
artifactId = rootProject.name
version = libraryVersionName
afterEvaluate {
from components.release
}
pom {
name = libraryPublishGroupName
description = libraryDescription
url = libraryUrl
licenses {
license {
name = libraryLicenseName
url = libraryLicenseUrl
}
}
developers {
developer {
id = 'Tianscar'
name = 'Karstian Lee'
email = 'tianscar@protonmail.com'
}
}
scm {
connection = libraryScmConnection
developerConnection = libraryScmDeveloperConnection
url = libraryScmUrl
}
}
}
}
repositories {
maven {
name = "OSSRH"
if (project.version.toString().endsWith("-SNAPSHOT")) {
url = "https://s01.oss.sonatype.org/content/repositories/snapshots"
} else {
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
}
signing {
sign(publishing.publications.release)
}
}