This repository was archived by the owner on Mar 31, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
165 lines (146 loc) · 4.31 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
165 lines (146 loc) · 4.31 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
import com.android.build.api.dsl.CommonExtension
import com.android.build.gradle.AppPlugin
import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.LibraryPlugin
import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
google()
}
dependencies {
classpath(libs.kotlin.gradle.plugin)
classpath(libs.kotlin.allopen)
classpath(libs.android.gradle.plugin)
classpath(libs.dokka.gradle.plugin)
classpath(libs.mavenPublish.gradle.plugin)
classpath(libs.benchmark.gradle.plugin)
}
}
allprojects {
group = "com.diglol.encoding"
version = "0.4.0-SNAPSHOT"
repositories {
mavenCentral()
google()
}
}
subprojects {
fun CommonExtension<*, *, *, *, *>.applyAndroid() {
lint {
textReport = true
textOutput = file("stdout")
lintConfig = rootProject.file("lint.xml")
checkDependencies = true
checkTestSources = false
explainIssues = false
checkReleaseBuilds = true
}
compileSdk = 33
defaultConfig {
minSdk = 21
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
plugins.withType<LibraryPlugin>().configureEach {
extensions.configure<LibraryExtension> { applyAndroid() }
}
plugins.withType<AppPlugin>().configureEach {
extensions.configure<BaseAppModuleExtension> {
applyAndroid()
defaultConfig.targetSdk = 33
}
}
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
}
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.addAll("-Xjvm-default=all")
}
}
tasks.withType(Test::class).configureEach {
testLogging {
if (System.getenv("CI") == "true") {
events = setOf(TestLogEvent.FAILED, TestLogEvent.SKIPPED, TestLogEvent.PASSED)
}
exceptionFormat = TestExceptionFormat.FULL
}
}
tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
normalization {
runtimeClasspath {
metaInf {
ignoreAttribute("Bnd-LastModified")
}
}
}
}
allprojects {
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
jdkVersion.set(8)
noAndroidSdkLink.set(true)
perPackageOption {
matchingRegex.set("diglol\\.encoding\\.internal\\.*")
suppress.set(true)
}
}
}
plugins.withId("com.vanniktech.maven.publish.base") {
configure<PublishingExtension> {
repositories {
maven {
name = "testMaven"
url = file("${rootProject.buildDir}/testMaven").toURI()
}
}
}
configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
pom {
description.set("Diglol Encoding provides Hex/Base16, Base32, Base45, Base64 encodings for Kotlin Multiplatform.")
name.set(project.name)
url.set("https://github.com/diglol/encoding/")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("diglol")
name.set("Diglol")
url.set("https://github.com/diglol/")
}
}
scm {
url.set("https://github.com/diglol/encoding/")
connection.set("scm:git:https://github.com/diglol/encoding.git")
developerConnection.set("scm:git:ssh://git@github.com/diglol/encoding.git")
}
}
}
}
}