-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle.kts
168 lines (148 loc) · 4.83 KB
/
build.gradle.kts
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
import org.jetbrains.compose.compose
import java.io.FileInputStream
import java.util.Properties
plugins {
id("com.android.library")
kotlin("multiplatform")
id("org.jetbrains.compose")
//id("maven-publish")
//id("signing")
}
group = "io.github.chozzle"
version = "0.1.0"
kotlin {
android()
jvm("desktop")
sourceSets {
named("commonMain") {
dependencies {
implementation(kotlin("stdlib-common"))
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
}
}
named("desktopMain") {
dependencies {
implementation(compose.desktop.common)
}
}
named("androidMain") {
dependencies {
kotlin.srcDirs("src/jvmMain/kotlin")
//implementation("androidx.appcompat:appcompat:1.1.0")
//implementation("androidx.core:core-ktx:1.3.1")
//implementation("com.google.android.material:material:1.2.1")
}
}
}
}
android {
compileSdkVersion(30)
defaultConfig {
minSdkVersion(21)
targetSdkVersion(30)
versionCode = 1
versionName = "1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
sourceSets {
named("main") {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
res.srcDirs("src/androidMain/res", "src/commonMain/resources")
}
}
}
/*
kotlin {
android {
publishLibraryVariants("release", "debug")
}
}
// Signing environment variables //
extra["signing.keyId"] = ""
extra["signing.password"] = ""
extra["signing.secretKeyRingFile"] = ""
extra["ossrhUsername"] = ""
extra["ossrhPassword"] = ""
val secretPropsFile = project.rootProject.file("local.properties")
if (secretPropsFile.exists()) {
println("Found secret props file, loading props")
val p = Properties()
p.load(FileInputStream(secretPropsFile))
p.forEach { name, value ->
extra[name as String] = value
}
} else {
// This is to facilitate CD in the future
println("No props file, loading env vars")
extra["signing.keyId"] = System.getenv("SIGNING_KEY_ID")
extra["signing.password"] = System.getenv("SIGNING_PASSWORD")
extra["signing.secretKeyRingFile"] = System.getenv("SIGNING_SECRET_KEY_RING_FILE")
extra["ossrhUsername"] = System.getenv("OSSRH_USERNAME")
extra["ossrhPassword"] = System.getenv("OSSRH_PASSWORD")
}
// Create empty jar for javadoc classifier to satisfy maven requirements
tasks.register<Jar>("stubJavadoc") {
archiveClassifier.set("javadoc")
}
signing {
sign(publishing.publications)
}
publishing {
publications.withType<MavenPublication>().configureEach {
pom {
name.set("Windows Theme for Compose")
description.set("A collection of components that follow Windows Fluent UI, written in Compose UI")
url.set("https://https://github.com/chozzle/compose-macos-theme")
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("Chozzle")
name.set("Carson Holzheimer")
}
}
scm {
url.set("https://https://github.com/chozzle/compose-macos-theme")
}
}
// Patch publications with fake javadoc
artifact(tasks.findByName("stubJavadoc"))
}
// Patch publications with fake javadoc
kotlin.targets.forEach { target ->
val targetPublication = publications.findByName(target.name)
if (targetPublication != null) {
targetPublication.name
}
}
repositories {
maven {
name = "mavencentral"
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
// You only need this if you want to publish snapshots, otherwise just set the URL
// to the release repo directly
url = if (version.toString().endsWith("SNAPSHOT")) {
uri(snapshotsRepoUrl)
} else {
uri(releasesRepoUrl)
}
authentication {
credentials {
username = project.extra["ossrhUsername"] as String
password = project.extra["ossrhPassword"] as String
}
}
}
}
}*/