forked from votingworks/electionguard-kotlin-multiplatform
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configure maven publish for kotlin multiplatform
upgrade to version 2.1.0-PREVIEW
- Loading branch information
1 parent
625c26e
commit 2a33401
Showing
3 changed files
with
37 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,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" | ||
|
||
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") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
// looks for local.properties file and provides the property if it exists | ||
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters