forked from votingworks/electionguard-kotlin-multiplatform
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
39 lines (34 loc) · 1.17 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
import java.util.*
plugins {
// this is necessary to avoid the plugins to be loaded multiple times
// in each subproject's classloader
kotlin("jvm") apply false
kotlin("multiplatform") apply false
}
subprojects {
group = "electionguard-kotlin-multiplatform"
version = "2.2.2"
apply(plugin = "maven-publish")
configure<PublishingExtension> {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/kastel-security/electionguard-kotlin-multiplatform")
credentials {
username = project.findLocalProperty("github.user") as String? ?: System.getenv("USERNAME")
password = project.findLocalProperty("github.key") as String? ?: System.getenv("TOKEN")
}
}
}
}
}
fun Project.findLocalProperty(name: String): Any? {
val localProperties = file("${project.rootDir}/local.properties")
return if (localProperties.exists()) {
val properties = Properties()
localProperties.inputStream().use { properties.load(it) }
properties[name]
} else {
null
}
}