-
-
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
0 parents
commit 34aa040
Showing
15 changed files
with
1,398 additions
and
0 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 @@ | ||
github: [ guimauvesoftware, nathanfallet ] |
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,22 @@ | ||
name: Run tests | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
- name: Install dependencies and run tests | ||
run: ./gradlew jvmTest koverXmlReport | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 |
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,46 @@ | ||
.gradle | ||
.kotlin | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
local.properties | ||
|
||
### IntelliJ IDEA ### | ||
.idea/ | ||
.fleet/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store | ||
.swiftpm | ||
|
||
### JS ### | ||
yarn.lock |
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 @@ | ||
# kaccelero | ||
|
||
[](LICENSE) | ||
[]() | ||
[]() | ||
[]() | ||
[](https://codecov.io/gh/guimauvesoftware/kaccelero) | ||
|
||
The all-in-one toolkit more mobile & web development in Kotlin/Swift. |
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,8 @@ | ||
allprojects { | ||
group = "dev.kaccelero" | ||
version = "0.1.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
} |
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,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
} |
93 changes: 93 additions & 0 deletions
93
convention-plugins/src/main/kotlin/convention.publication.gradle.kts
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,93 @@ | ||
import java.util.* | ||
|
||
plugins { | ||
`maven-publish` | ||
signing | ||
} | ||
|
||
// Stub secrets to let the project sync and build without the publication values set up | ||
ext["signing.keyId"] = null | ||
ext["signing.password"] = null | ||
ext["signing.secretKeyRingFile"] = null | ||
ext["ossrhUsername"] = null | ||
ext["ossrhPassword"] = null | ||
|
||
// Grabbing secrets from local.properties file or from environment variables, which could be used on CI | ||
val secretPropsFile = project.rootProject.file("local.properties") | ||
if (secretPropsFile.exists()) { | ||
secretPropsFile.reader().use { | ||
Properties().apply { | ||
load(it) | ||
} | ||
}.onEach { (name, value) -> | ||
ext[name.toString()] = value | ||
} | ||
} else { | ||
ext["signing.keyId"] = System.getenv("SIGNING_KEY_ID") | ||
ext["signing.password"] = System.getenv("SIGNING_PASSWORD") | ||
ext["signing.secretKeyRingFile"] = System.getenv("SIGNING_SECRET_KEY_RING_FILE") | ||
ext["ossrhUsername"] = System.getenv("OSSRH_USERNAME") | ||
ext["ossrhPassword"] = System.getenv("OSSRH_PASSWORD") | ||
} | ||
|
||
val javadocJar by tasks.registering(Jar::class) { | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
fun getExtraString(name: String) = ext[name]?.toString() | ||
|
||
publishing { | ||
// Configure maven central repository | ||
repositories { | ||
maven { | ||
name = "sonatype" | ||
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
credentials { | ||
username = getExtraString("ossrhUsername") | ||
password = getExtraString("ossrhPassword") | ||
} | ||
} | ||
} | ||
|
||
// Configure all publications | ||
publications.withType<MavenPublication> { | ||
// Stub javadoc.jar artifact | ||
artifact(javadocJar.get()) | ||
|
||
// Provide artifacts information requited by Maven Central | ||
pom { | ||
url.set("https://github.com/guimauvesoftware/kaccelero") | ||
|
||
licenses { | ||
license { | ||
name.set("GPL-3.0") | ||
url.set("https://opensource.org/licenses/GPL-3.0") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("NathanFallet") | ||
name.set("Nathan Fallet") | ||
email.set("[email protected]") | ||
url.set("https://www.nathanfallet.me") | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/guimauvesoftware/kaccelero.git") | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Signing artifacts. Signing.* extra properties values will be used | ||
signing { | ||
sign(publishing.publications) | ||
} | ||
|
||
// The Gradle Nexus plugin has a bug that requires us to manually | ||
// configure the signing tasks to run before the publishing tasks. | ||
// see: https://github.com/gradle-nexus/publish-plugin/issues/208 | ||
val signingTasks: TaskCollection<Sign> = tasks.withType<Sign>() | ||
tasks.withType<PublishToMavenRepository>().configureEach { | ||
mustRunAfter(signingTasks) | ||
} |
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,105 @@ | ||
plugins { | ||
alias(libs.plugins.multiplatform) | ||
alias(libs.plugins.serialization) | ||
alias(libs.plugins.kover) | ||
alias(libs.plugins.ksp) | ||
id("convention.publication") | ||
} | ||
|
||
publishing { | ||
publications.withType<MavenPublication> { | ||
pom { | ||
name.set("core") | ||
description.set("Core of kaccelero.") | ||
} | ||
} | ||
} | ||
|
||
kotlin { | ||
// Tiers are in accordance with <https://kotlinlang.org/docs/native-target-support.html> | ||
// Tier 1 | ||
macosX64() | ||
macosArm64() | ||
iosSimulatorArm64() | ||
iosX64() | ||
|
||
// Tier 2 | ||
linuxX64() | ||
linuxArm64() | ||
watchosSimulatorArm64() | ||
watchosX64() | ||
watchosArm32() | ||
watchosArm64() | ||
tvosSimulatorArm64() | ||
tvosX64() | ||
tvosArm64() | ||
iosArm64() | ||
|
||
// Tier 3 | ||
mingwX64() | ||
watchosDeviceArm64() | ||
|
||
// jvm & js | ||
jvmToolchain(21) | ||
jvm { | ||
withJava() | ||
testRuns.named("test") { | ||
executionTask.configure { | ||
useJUnitPlatform() | ||
} | ||
} | ||
} | ||
js { | ||
binaries.library() | ||
nodejs() | ||
browser() | ||
//generateTypeScriptDefinitions() // Not supported for now because of collections etc... | ||
} | ||
|
||
applyDefaultHierarchyTemplate() | ||
sourceSets { | ||
all { | ||
languageSettings.apply { | ||
optIn("kotlin.js.ExperimentalJsExport") | ||
} | ||
} | ||
val commonMain by getting { | ||
dependencies { | ||
api(libs.kotlinx.coroutines) | ||
api(libs.kotlinx.serialization.json) | ||
api(libs.kotlinx.datetime) | ||
} | ||
} | ||
val nativeMain by getting {} | ||
val jvmMain by getting { | ||
dependencies { | ||
implementation(kotlin("reflect")) | ||
} | ||
} | ||
val jvmTest by getting { | ||
dependencies { | ||
implementation(kotlin("test")) | ||
implementation(libs.tests.mockk) | ||
} | ||
} | ||
val desktopAndJsMain by creating { | ||
dependsOn(commonMain) | ||
} | ||
val jsMain by getting { | ||
dependsOn(desktopAndJsMain) | ||
dependencies { | ||
api(libs.kotlin.js) | ||
} | ||
} | ||
val desktopMain by creating { | ||
dependsOn(nativeMain) | ||
dependsOn(desktopAndJsMain) | ||
} | ||
val mingwMain by getting { | ||
dependsOn(desktopMain) | ||
} | ||
val linuxMain by getting { | ||
dependsOn(desktopMain) | ||
} | ||
} | ||
} |
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 @@ | ||
kotlin.code.style=official |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.