Skip to content

Commit

Permalink
Updated dependencies and converted some build files to use Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
chRyNaN committed Dec 28, 2021
1 parent 463aba4 commit 537e578
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 190 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
**/.idea/fileTemplates
**/.idea/dictionaries
**/.idea/caches
**/.idea/**
local.properties
/captures
.externalNativeBuild
Expand Down
37 changes: 0 additions & 37 deletions build.gradle

This file was deleted.

36 changes: 36 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import com.chrynan.chords.buildSrc.LibraryConstants

group = LibraryConstants.group
version = LibraryConstants.versionName

buildscript {
repositories {
mavenCentral()
google()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
maven { url = uri("https://repo.repsy.io/mvn/chrynan/public") }
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.5.31")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.5.30")
classpath("org.jetbrains.compose:compose-gradle-plugin:1.0.0")
}
}

apply(plugin = "org.jetbrains.dokka")

allprojects {
repositories {
google()
mavenCentral()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
maven { url = uri("https://repo.repsy.io/mvn/chrynan/public") }
}
}

// Documentation
tasks.named<org.jetbrains.dokka.gradle.DokkaMultiModuleTask>("dokkaGfmMultiModule").configure {
outputDirectory.set(file("${projectDir.path}/docs"))
}
6 changes: 0 additions & 6 deletions chords-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ android {
kotlinCompilerExtensionVersion "1.0.0-beta02"
}

configurations {
create("testApi")
create("testDebugApi")
create("testReleaseApi")
}

sourceSets {
main {
manifest.srcFile "src/androidMain/AndroidManifest.xml"
Expand Down
133 changes: 0 additions & 133 deletions chords-core/build.gradle

This file was deleted.

109 changes: 109 additions & 0 deletions chords-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import com.chrynan.chords.buildSrc.LibraryConstants
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("multiplatform")
id("com.android.library")
id("kotlinx-serialization")
id("maven-publish")
id("org.jetbrains.dokka")
}

group = LibraryConstants.group
version = LibraryConstants.versionName

kotlin {
android {
publishAllLibraryVariants()
publishLibraryVariantsGroupedByFlavor = true
}
targets {
android()
jvm()
js(BOTH) {
browser()
nodejs()
}
ios()
}

sourceSets {
commonMain {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0")

api("com.chrynan.colors:colors-core:0.7.0")
}
}
all {
languageSettings.enableLanguageFeature("InlineClasses")
languageSettings.useExperimentalAnnotation("kotlin.RequiresOptIn")
}
}
}

android {
compileSdk = LibraryConstants.Android.compileSdkVersion

defaultConfig {
minSdk = LibraryConstants.Android.minSdkVersion
targetSdk = LibraryConstants.Android.targetSdkVersion
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
// Opt-in to experimental compose APIs
freeCompilerArgs = listOf(
"-Xopt-in=kotlin.RequiresOptIn"
)
}
}

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].java.srcDirs("src/androidMain/kotlin")
sourceSets["main"].res.srcDirs("src/androidMain/res")

sourceSets["test"].java.srcDirs("src/androidTest/kotlin")
sourceSets["test"].res.srcDirs("src/androidTest/res")
}

tasks.withType<Jar> { duplicatesStrategy = DuplicatesStrategy.INHERIT }

dependencies {
implementation("androidx.annotation:annotation:1.3.0")

implementation("androidx.appcompat:appcompat:1.4.0")

implementation("com.chrynan.parcelable:parcelable-core:0.3.1")
implementation("com.chrynan.parcelable:parcelable-android:0.3.1")
}

afterEvaluate {
publishing {
repositories {
maven {
url = uri("https://repo.repsy.io/mvn/chrynan/public")

credentials {
username = (project.findProperty("repsyUsername") ?: System.getenv("repsyUsername")) as? String
password = (project.findProperty("repsyToken") ?: System.getenv("repsyToken")) as? String
}
}
}
}
}
2 changes: 1 addition & 1 deletion sample-android/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
6 changes: 0 additions & 6 deletions sample-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ android {
kotlinCompilerExtensionVersion "1.0.0-beta02"
}

configurations {
create("testApi")
create("testDebugApi")
create("testReleaseApi")
}

sourceSets {
main {
manifest.srcFile "src/androidMain/AndroidManifest.xml"
Expand Down
7 changes: 0 additions & 7 deletions settings.gradle

This file was deleted.

7 changes: 7 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rootProject.name = "chords"

include(":chords-core")
include(":chords-compose")
// include ":sample-android"
include(":sample-js")
include(":sample-compose")

0 comments on commit 537e578

Please sign in to comment.