forked from Guardsquare/proguard-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
234 lines (219 loc) · 7.33 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
plugins {
// id 'distribution'
// id 'io.github.gradle-nexus.publish-plugin'
id 'java-library'
id "org.jetbrains.kotlin.jvm" //version "$kotlinVersion"
// id 'maven-publish'
// id 'signing'
// id 'com.adarshr.test-logger' version '3.0.0'
// id 'de.jansauer.printcoverage' version '2.0.0'
// id 'jacoco'
// id "org.jlleitschuh.gradle.ktlint" version '10.1.0'
// id "org.sonarqube" version "3.3"
}
//sonarqube {
// properties {
// property "sonar.sources", "src"
// }
//}
group = 'com.guardsquare'
version = proguardCoreVersion
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
//javadoc {
// title = 'ProGuardCORE'
// source = sourceSets.main.allJava
// destinationDir = file('docs/md/api')
// options.addStringOption('Xdoclint:none', '-quiet')
//}
//task buildDocumentation(type: Exec) {
// dependsOn javadoc
// inputs.dir 'docs/md'
// inputs.file 'docs/mkdocs.yml'
// outputs.dir 'docs/html'
// executable 'sh'
// args '-c', "docker run --volume $rootDir/docs:/docs --rm squidfunk/mkdocs-material:5.2.2 build"
//}
//clean {
// delete javadoc.outputs
// delete buildDocumentation.outputs
//}
dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
api "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlinVersion}"
api "org.jetbrains.kotlinx:kotlinx-metadata-jvm:${kotlinxMetadataVersion}"
// Kotlin version for tests should be the same as the dependencies
// of the kotlin-compile-testing and kotest.
testImplementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.32"
testImplementation "org.jetbrains.kotlin:kotlin-reflect:1.4.32"
testImplementation 'com.github.tschuchortdev:kotlin-compile-testing:1.3.0'
testImplementation 'io.kotest:kotest-runner-junit5-jvm:4.5.0' // for kotest framework
testImplementation 'io.kotest:kotest-assertions-core-jvm:4.5.0' // for kotest core jvm assertions
testImplementation 'io.kotest:kotest-property-jvm:4.5.0' // for kotest property test
testImplementation "io.mockk:mockk:1.12.0" // for mocking
// For assembling ProGuard assembler snippets
testImplementation ('com.github.Guardsquare:proguard-assembler:master-SNAPSHOT') {
exclude group: 'com.guardsquare', module: 'proguard-core'
}
}
targetCompatibility = "1.8"
sourceCompatibility = "1.8"
java {
// toolchain {
// languageVersion.set(JavaLanguageVersion.of(8))
// }
sourceCompatibility = JavaVersion.toVersion("1.8")
targetCompatibility = JavaVersion.toVersion("1.8")
// withSourcesJar()
// withJavadocJar()
}
// Early access automatic downloads are not yet supported:
// https://github.com/gradle/gradle/issues/14814
// But it will work if e.g. Java 17-ea is pre-installed
//def javaVersionsForTest = 9..16
//
//test {
// useJUnitPlatform()
//}
//
//task testAllJavaVersions() { testAllTask ->
// dependsOn(test) // the usual test runs on Java 8
//
// javaVersionsForTest.each {version ->
// task("testJava$version", type: Test) {
// useJUnitPlatform()
// ignoreFailures = true
//
// testAllTask.dependsOn(it)
//
// javaLauncher = javaToolchains.launcherFor {
// languageVersion = JavaLanguageVersion.of(version)
// }
// }
// }
//}
//
//tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
// kotlinOptions {
// jvmTarget = '1.8'
// }
//}
//
//jacocoTestReport {
// // Define which classes need to be monitored
// def sources = files(rootProject.sourceSets.main.allSource.srcDirs)
// sourceDirectories.setFrom(sources)
// additionalSourceDirs.setFrom(sources)
// sourceDirectories.setFrom(sources)
// def classes = files(rootProject.sourceSets.main.output.classesDirs)
// classDirectories.setFrom(classes)
// executionData.setFrom project.fileTree(dir: '.', include: '**/build/jacoco/*.exec')
// reports {
// xml.enabled true
// csv.enabled false
// html.destination file("${buildDir}/reports/coverage")
// }
//}
//
//distributions {
// main {
// distributionBaseName.set('proguard-core')
// contents {
// into('lib') {
// from tasks.getByName('jar').outputs
// }
// into('docs') {
// from('docs/md') {
// includeEmptyDirs = false
// include '**/*.md'
// }
// }
// from(rootDir) {
// include 'examples/'
// include 'LICENSE'
// }
// }
// }
//}
//
//distTar {
// compression = Compression.GZIP
// archiveExtension.set('tar.gz')
// dependsOn('javadoc')
//}
//
//distZip {
// dependsOn('javadoc')
//}
//
//nexusPublishing {
// repositories {
// sonatype {
// username = findProperty('PROGUARD_STAGING_USERNAME')
// password = findProperty('PROGUARD_STAGING_PASSWORD')
// }
// }
//}
//
//publishing {
// publications {
// create('proguardCore', MavenPublication) {
// from components.java
// pom {
// name = "$groupId:$artifactId"
// description = 'ProGuardCORE is a free library to read, analyze, modify, and write Java class files.'
// url = 'https://guardsquare.github.io/proguard-core'
// developers {
// developer {
// id = 'lafortune'
// name = 'Eric Lafortune'
// organization = 'Guardsquare'
// organizationUrl = 'https://www.guardsquare.com/'
// roles = ['Project Administrator', 'Developer']
// }
// }
// licenses {
// license {
// name = 'Apache License Version 2.0'
// url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
// distribution = 'repo'
// }
// }
// issueManagement {
// system = 'Github Tracker'
// url = 'https://github.com/Guardsquare/proguard-core/issues'
// }
// scm {
// url = 'https://github.com/Guardsquare/proguard-core.git'
// connection = 'scm:git:https://github.com/Guardsquare/proguard-core.git'
// }
// properties = [
// 'project.build.sourceEncoding': 'UTF-8'
// ]
// }
// }
// }
// repositories {
// maven {
// name = 'Github'
// url = uri('https://maven.pkg.github.com/guardsquare/proguard-core')
// credentials {
// username = project.findProperty('PROGUARD_GITHUB_USERNAME')
// password = project.findProperty('PROGUARD_GITHUB_TOKEN')
// }
// }
// }
//}
//
//// We use in-memory ascii-armored keys
//// See https://docs.gradle.org/current/userguide/signing_plugin.html#sec:in-memory-keys
//if (hasProperty('PROGUARD_SIGNING_KEY')) {
// signing {
// String key = findProperty('PROGUARD_SIGNING_KEY')
// String password = findProperty('PROGUARD_SIGNING_PASSWORD')
// useInMemoryPgpKeys(key, password)
// sign publishing.publications.proguardCore
// }
//}