-
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.
Merge pull request #4 from iodigital-com/gradle-plugin-2
Add gradle plugin, improve mode handling
- Loading branch information
Showing
67 changed files
with
1,529 additions
and
550 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 |
---|---|---|
|
@@ -20,7 +20,15 @@ jobs: | |
|
||
- name: Build distribution | ||
id: build | ||
run: gradle clean build -PAzureBuildNumber="${{ github.run_id }}" | ||
run: ./gradlew clean build -PAzureBuildNumber="${{ github.run_id }}" | ||
|
||
- name: Publish to Maven Central | ||
run: ./gradlew publish | ||
env: | ||
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }} | ||
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }} | ||
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }} | ||
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }} | ||
|
||
- name: Create tag | ||
uses: tvdias/[email protected] | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
plugins { | ||
//trick: for the same plugin versions in all sub-modules | ||
alias(libs.plugins.kotlinMultiplatform).apply(false) | ||
alias(libs.plugins.kotlinSerialization).apply(false) | ||
alias(libs.plugins.kotlinMultiplatform) apply false | ||
alias(libs.plugins.kotlinSerialization) apply false | ||
alias(libs.plugins.jetbrainsKotlinJvm) apply false | ||
alias(libs.plugins.mavenPublishing) apply false | ||
} | ||
|
||
|
||
val buildNumber = (findProperty("AzureBuildNumber") ?: "debug").toString().replace(".", "-") | ||
val buildVersion = "${project.property("VERSION_NAME")}.$buildNumber" | ||
|
||
println("##vso[build.updatebuildnumber]name=$buildVersion,code=$buildVersion,buildId=$buildNumber") | ||
File(System.getenv("GITHUB_OUTPUT") ?: "/dev/null").appendText("build_version=$buildVersion") | ||
|
||
subprojects { | ||
version = buildVersion | ||
} |
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,48 @@ | ||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.kotlinSerialization) | ||
application | ||
} | ||
|
||
kotlin { | ||
jvm() | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(libs.kotlinx.cli) | ||
implementation(libs.ktor.core) | ||
implementation(project(":figex-core")) | ||
} | ||
} | ||
} | ||
|
||
distributions { | ||
main { | ||
distributionBaseName.set("figex") | ||
contents { | ||
into("") { | ||
val jvmJar by tasks.getting | ||
from(jvmJar) | ||
from("src/figex") | ||
} | ||
into("lib/") { | ||
val main by kotlin.jvm().compilations.getting | ||
from(main.runtimeDependencyFiles) | ||
} | ||
exclude("**/figma-exporter") | ||
exclude("**/figma-exporter.bat") | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<Jar> { | ||
doFirst { | ||
manifest { | ||
val main by kotlin.jvm().compilations.getting | ||
attributes( | ||
"Main-Class" to "com.iodigital.figex.MainKt", | ||
"Class-Path" to main.runtimeDependencyFiles.files.joinToString(" ") { "lib/" + it.name } | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.