Skip to content

Commit

Permalink
Backporting improvements from klip and monko
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetuska committed Aug 26, 2021
1 parent 931a96c commit 737e139
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 33 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ on:

env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
MONGO_URL: ${{ secrets.MONGO_URL }}

jobs:
build:
Expand Down Expand Up @@ -101,6 +100,14 @@ jobs:

- name: Run Command
if: ${{ startsWith(matrix.os.runner, github.event.inputs.runner) }}
env:
GH_USERNAME: ${{ github.actor }}
GH_PASSWORD: ${{ github.token }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
run: ${{ github.event.inputs.command }}

- uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id("plugin.library-mpp")
id("plugin.publishing-mpp")
id("plugin.publishing-nexus")
id("plugin.publishing-mpp")
id("com.github.jakemarsden.git-hooks")
}

Expand Down
30 changes: 0 additions & 30 deletions buildSrc/src/main/kotlin/plugin.publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,36 +61,6 @@ tasks {
}

publishing {
fun Collection<KotlinTarget>.onlyBuildIf(enabled: Spec<in Task>) {
forEach {
it.compilations.all {
compileKotlinTask.onlyIf(enabled)
}
}
}

fun Collection<Named>.onlyPublishIf(enabled: Spec<in Task>) {
val publications: Collection<String> = map { it.name }
afterEvaluate {
publishing {
publications {
matching { it.name in publications }.all {
val targetPublication = this@all
tasks.withType<AbstractPublishToMaven>()
.matching { it.publication == targetPublication }
.configureEach {
onlyIf(enabled)
}
tasks.withType<GenerateModuleMetadata>()
.matching { it.publication.get() == targetPublication }
.configureEach {
onlyIf(enabled)
}
}
}
}
}
}
publications {
val ghOwnerId: String = project.properties["gh.owner.id"]!!.toString()
val ghOwnerName: String = project.properties["gh.owner.name"]!!.toString()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ group=dev.petuska
description=Template for kotlin multiplatform library
version=0.0.0
#======================================== Build =========================================
# linux | osx | windows
# linux | macos | windows
project.mainOS=linux

0 comments on commit 737e139

Please sign in to comment.