Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanfallet committed Jun 17, 2024
0 parents commit 34aa040
Show file tree
Hide file tree
Showing 15 changed files with 1,398 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [ guimauvesoftware, nathanfallet ]
22 changes: 22 additions & 0 deletions .github/workflows/tests.yml
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
46 changes: 46 additions & 0 deletions .gitignore
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
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# kaccelero

[![License](https://img.shields.io/github/license/guimauvesoftware/kaccelero)](LICENSE)
[![Issues](https://img.shields.io/github/issues/guimauvesoftware/kaccelero)]()
[![Pull Requests](https://img.shields.io/github/issues-pr/guimauvesoftware/kaccelero)]()
[![Code Size](https://img.shields.io/github/languages/code-size/guimauvesoftware/kaccelero)]()
[![codecov](https://codecov.io/gh/guimauvesoftware/kaccelero/graph/badge.svg?token=XZ7HrShgH3)](https://codecov.io/gh/guimauvesoftware/kaccelero)

The all-in-one toolkit more mobile & web development in Kotlin/Swift.
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
allprojects {
group = "dev.kaccelero"
version = "0.1.0"

repositories {
mavenCentral()
}
}
7 changes: 7 additions & 0 deletions convention-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
gradlePluginPortal()
}
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)
}
105 changes: 105 additions & 0 deletions core/build.gradle.kts
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)
}
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin.code.style=official
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
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
Loading

0 comments on commit 34aa040

Please sign in to comment.