-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13b093d
commit 284ef8b
Showing
12 changed files
with
850 additions
and
162 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This file was generated using a Kotlin DSL. | ||
# If you want to modify the workflow, please change the Kotlin source and regenerate this YAML file. | ||
# Generated with https://github.com/typesafegithub/github-workflows-kt | ||
|
||
name: 'dbuild' | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'main' | ||
pull_request: {} | ||
jobs: | ||
build-for-UbuntuLatest: | ||
runs-on: 'ubuntu-latest' | ||
env: | ||
MYKOTLIBS_signing_keyId: '${{ secrets.MYKOTLIBS_signing_keyId }}' | ||
MYKOTLIBS_signing_password: '${{ secrets.MYKOTLIBS_signing_password }}' | ||
MYKOTLIBS_signing_key: '${{ secrets.MYKOTLIBS_signing_key }}' | ||
MYKOTLIBS_ossrhUsername: '${{ secrets.MYKOTLIBS_ossrhUsername }}' | ||
MYKOTLIBS_ossrhPassword: '${{ secrets.MYKOTLIBS_ossrhPassword }}' | ||
MYKOTLIBS_sonatypeStagingProfileId: '${{ secrets.MYKOTLIBS_sonatypeStagingProfileId }}' | ||
steps: | ||
- id: 'step-0' | ||
uses: 'actions/checkout@v3' | ||
- id: 'step-1' | ||
name: 'Set up JDK' | ||
uses: 'actions/setup-java@v3' | ||
with: | ||
java-version: '17' | ||
distribution: 'zulu' | ||
- id: 'step-2' | ||
name: 'Build' | ||
uses: 'gradle/gradle-build-action@v2' | ||
with: | ||
arguments: 'build' |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This file was generated using a Kotlin DSL. | ||
# If you want to modify the workflow, please change the Kotlin source and regenerate this YAML file. | ||
# Generated with https://github.com/typesafegithub/github-workflows-kt | ||
|
||
name: 'drelease' | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
jobs: | ||
release: | ||
runs-on: 'ubuntu-latest' | ||
env: | ||
MYKOTLIBS_signing_keyId: '${{ secrets.MYKOTLIBS_signing_keyId }}' | ||
MYKOTLIBS_signing_password: '${{ secrets.MYKOTLIBS_signing_password }}' | ||
MYKOTLIBS_signing_key: '${{ secrets.MYKOTLIBS_signing_key }}' | ||
MYKOTLIBS_ossrhUsername: '${{ secrets.MYKOTLIBS_ossrhUsername }}' | ||
MYKOTLIBS_ossrhPassword: '${{ secrets.MYKOTLIBS_ossrhPassword }}' | ||
MYKOTLIBS_sonatypeStagingProfileId: '${{ secrets.MYKOTLIBS_sonatypeStagingProfileId }}' | ||
steps: | ||
- id: 'step-0' | ||
uses: 'actions/checkout@v3' | ||
- id: 'step-1' | ||
name: 'Set up JDK' | ||
uses: 'actions/setup-java@v3' | ||
with: | ||
java-version: '17' | ||
distribution: 'zulu' | ||
- id: 'step-2' | ||
name: 'Build' | ||
uses: 'gradle/gradle-build-action@v2' | ||
with: | ||
arguments: 'build' | ||
- id: 'step-3' | ||
name: 'Publish to Sonatype' | ||
uses: 'gradle/gradle-build-action@v2' | ||
with: | ||
arguments: 'publishToSonatype closeAndReleaseSonatypeStagingRepository' |
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,72 +1,79 @@ | ||
import pl.mareklangiewicz.defaults.* | ||
import pl.mareklangiewicz.ure.* | ||
import pl.mareklangiewicz.deps.* | ||
import pl.mareklangiewicz.utils.* | ||
|
||
plugins { | ||
id("io.github.gradle-nexus.publish-plugin") version vers.nexusPublishGradlePlugin | ||
kotlin("multiplatform") version vers.kotlin apply false | ||
plug(plugs.NexusPublish) | ||
plug(plugs.KotlinMulti) apply false | ||
plug(plugs.KotlinJvm) apply false | ||
} | ||
|
||
defaultGroupAndVerAndDescription(libs.SMokK) | ||
|
||
defaultSonatypeOssStuffFromSystemEnvs() | ||
defaultBuildTemplateForRootProject( | ||
langaraLibDetails( | ||
name = "SMokK", | ||
description = "A bit scary library for mocking suspendable functions in Kotlin :-)", | ||
githubUrl = "https://github.com/langara/SMokK", | ||
version = Ver(0, 0, 7) | ||
// https://repo1.maven.org/maven2/pl/mareklangiewicz/smokk/ | ||
// https://github.com/langara/SMokK/releases | ||
), | ||
withSonatypeOssPublishing = true, | ||
) | ||
|
||
private val rootBuild = rootProjectPath / "build.gradle.kts" | ||
private val smokkModuleBuild = rootProjectPath / "smokk" / "build.gradle.kts" | ||
private val smokkxModuleBuild = rootProjectPath / "smokkx" / "build.gradle.kts" | ||
private val kotlinSampleModuleBuild = rootProjectPath / "kotlinsample" / "build.gradle.kts" | ||
// FIXME: make sure this region below is synced, but not as a part of "self-sync" as it was in DepsKt, | ||
// but as normal sync when syncing all regions in all projects. | ||
// The "self-sync" should only sync templates (and be renamed to templates-sync or sth) | ||
|
||
tasks.registerAllThatGroupFun("inject", | ||
::checkTemplates, | ||
::injectTemplates, | ||
) | ||
// region [Root Build Template] | ||
|
||
fun checkTemplates() { | ||
checkRootBuildTemplate(rootBuild) | ||
checkKotlinModuleBuildTemplates(smokkModuleBuild, smokkxModuleBuild, kotlinSampleModuleBuild) | ||
checkMppModuleBuildTemplates(smokkModuleBuild, smokkxModuleBuild) | ||
checkJvmAppBuildTemplates(kotlinSampleModuleBuild) | ||
} | ||
/** Publishing to Sonatype OSSRH has to be explicitly allowed here, by setting withSonatypeOssPublishing to true. */ | ||
fun Project.defaultBuildTemplateForRootProject( | ||
libDetails: LibDetails? = null, | ||
withSonatypeOssPublishing: Boolean = false | ||
) { | ||
check(libDetails != null || !withSonatypeOssPublishing) | ||
ext.addDefaultStuffFromSystemEnvs() | ||
libDetails?.let { | ||
rootExtLibDetails = it | ||
defaultGroupAndVerAndDescription(it) | ||
if (withSonatypeOssPublishing) defaultSonatypeOssNexusPublishing() | ||
} | ||
|
||
fun injectTemplates() { | ||
injectRootBuildTemplate(rootBuild) | ||
injectKotlinModuleBuildTemplate(smokkModuleBuild, smokkxModuleBuild, kotlinSampleModuleBuild) | ||
injectMppModuleBuildTemplate(smokkModuleBuild, smokkxModuleBuild) | ||
injectJvmAppBuildTemplate(kotlinSampleModuleBuild) | ||
// kinda workaround for kinda issue with kotlin native | ||
// https://youtrack.jetbrains.com/issue/KT-48410/Sync-failed.-Could-not-determine-the-dependencies-of-task-commonizeNativeDistribution.#focus=Comments-27-5144160.0-0 | ||
repositories { mavenCentral() } | ||
} | ||
|
||
// region [Root Build Template] | ||
|
||
/** | ||
* System.getenv() should contain six env variables with given prefix, like: | ||
* * MYKOTLIBS_signing_keyId | ||
* * MYKOTLIBS_signing_password | ||
* * MYKOTLIBS_signing_key | ||
* * MYKOTLIBS_signing_keyFile (or MYKOTLIBS_signing_key with whole signing key) | ||
* * MYKOTLIBS_ossrhUsername | ||
* * MYKOTLIBS_ossrhPassword | ||
* * MYKOTLIBS_sonatypeStagingProfileId | ||
* * First three of these used in fun pl.mareklangiewicz.defaults.defaultSigning | ||
* * See deps.kt/template-mpp/template-mpp-lib/build.gradle.kts | ||
* * See DepsKt/template-mpp/template-mpp-lib/build.gradle.kts | ||
*/ | ||
fun Project.defaultSonatypeOssStuffFromSystemEnvs(envKeyMatchPrefix: String = "MYKOTLIBS_") { | ||
ext.addAllFromSystemEnvs(envKeyMatchPrefix) | ||
defaultSonatypeOssNexusPublishing() | ||
} | ||
fun ExtraPropertiesExtension.addDefaultStuffFromSystemEnvs(envKeyMatchPrefix: String = "MYKOTLIBS_") = | ||
addAllFromSystemEnvs(envKeyMatchPrefix) | ||
|
||
fun Project.defaultSonatypeOssNexusPublishing( | ||
sonatypeStagingProfileId: String = rootExt("sonatypeStagingProfileId"), | ||
ossrhUsername: String = rootExt("ossrhUsername"), | ||
ossrhPassword: String = rootExt("ossrhPassword"), | ||
) = nexusPublishing { | ||
repositories { | ||
sonatype { //only for users registered in Sonatype after 24 Feb 2021 | ||
stagingProfileId put sonatypeStagingProfileId | ||
username put ossrhUsername | ||
password put ossrhPassword | ||
nexusUrl put uri(repos.sonatypeOssNexus) | ||
snapshotRepositoryUrl put uri(repos.sonatypeOssSnapshots) | ||
sonatypeStagingProfileId: String = rootExtString["sonatypeStagingProfileId"], | ||
ossrhUsername: String = rootExtString["ossrhUsername"], | ||
ossrhPassword: String = rootExtString["ossrhPassword"], | ||
) { | ||
nexusPublishing { | ||
this.repositories { | ||
sonatype { // only for users registered in Sonatype after 24 Feb 2021 | ||
stagingProfileId put sonatypeStagingProfileId | ||
username put ossrhUsername | ||
password put ossrhPassword | ||
nexusUrl put repos.sonatypeOssNexus | ||
snapshotRepositoryUrl put repos.sonatypeOssSnapshots | ||
} | ||
} | ||
} | ||
} | ||
|
||
// endregion [Root Build Template] | ||
// endregion [Root Build Template] |
Binary file not shown.
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,5 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
Oops, something went wrong.