Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for build with kts #739

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions basicSample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id "com.android.application"
id "kotlin-android"
}

android {
namespace 'info.mqtt.java.example'
namespace "info.mqtt.java.example"
defaultConfig {
applicationId "info.mqtt.java.example"
minSdkVersion 21
Expand All @@ -14,7 +14,7 @@ android {
versionName getTag()

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments useTestStorageService: 'true'
testInstrumentationRunnerArguments useTestStorageService: "true"
}

buildFeatures {
Expand All @@ -26,22 +26,22 @@ android {
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
jvmTarget = "17"
}
}

dependencies {
implementation project(':serviceLibrary')
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation project(":serviceLibrary")
implementation "androidx.appcompat:appcompat:1.7.0"
implementation "com.google.android.material:material:1.12.0"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation "com.github.AppDevNext.Logcat:LogcatCoreLib:$logcatVersion"

implementation "androidx.core:core-ktx:1.15.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'com.github.AppDevNext:Moka:1.6'
testImplementation "junit:junit:4.13.2"
androidTestImplementation "com.github.AppDevNext:Moka:1.6"
androidTestImplementation "androidx.test.ext:junit-ktx:1.1.5"
androidTestUtil "androidx.test.services:test-services:1.4.2"
}
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import org.gradle.internal.jvm.Jvm

buildscript {
ext.kotlin_version = '2.1.0'
ext.kotlin_version = "2.1.0"
repositories {
mavenCentral()
google()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "com.android.tools.build:gradle:8.7.3"
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:12.1.2"
}
}

plugins {
id 'com.google.devtools.ksp' version '2.1.0-1.0.29' apply false
id "com.google.devtools.ksp" version "2.1.0-1.0.29" apply false
}

println "Gradle uses Java ${Jvm.current()}"
Expand All @@ -42,12 +42,12 @@ allprojects {
google()
mavenCentral()
maven { url "https://repo.eclipse.org/content/repositories/paho-releases/" }
maven { url 'https://jitpack.io' }
maven { url "https://jitpack.io" }
}

}

@SuppressWarnings('unused')
@SuppressWarnings("unused")
static def getTag() {
def tagVersion = "$System.env.VERSION"
if (tagVersion.toString().equals("null")) {
Expand All @@ -63,7 +63,7 @@ static def getTag() {
return tagVersion
}

@SuppressWarnings('unused')
@SuppressWarnings("unused")
static def getGitCommitCount() {
def process = "git rev-list HEAD --count".execute()
return process.text.toInteger()
Expand Down
28 changes: 14 additions & 14 deletions serviceLibrary/build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'maven-publish'
id 'com.google.devtools.ksp'
id "com.android.library"
id "kotlin-android"
id "maven-publish"
id "com.google.devtools.ksp"
}

android {
namespace 'info.mqtt.android.service'
testNamespace 'info.mqtt.android.service.test'
namespace "info.mqtt.android.service"
testNamespace "info.mqtt.android.service.test"
defaultConfig {
minSdkVersion 21
compileSdk rootProject.ext.compileSdkVersion
targetSdkVersion rootProject.ext.targetSdk

// Android Studio 4.1 doesn't generate versionName in libraries any more
// Android Studio 4.1 doesn"t generate versionName in libraries any more
// https://developer.android.com/studio/releases/gradle-plugin#version_properties_removed_from_buildconfig_class_in_library_projects
buildConfigField "String", 'VERSION_NAME', "\"" + getTag() + "\""
buildConfigField "String", "VERSION_NAME", "\"${getTag()}\""

testApplicationId "info.mgtt.android.service.test"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments useTestStorageService: 'true'
testInstrumentationRunnerArguments useTestStorageService: "true"

packagingOptions {
pickFirst 'META-INF/serviceLibrary_debug.kotlin_module'
pickFirst "META-INF/serviceLibrary_debug.kotlin_module"
}

ksp {
arg('room.schemaLocation', "$projectDir/schemas")
arg("room.schemaLocation", "$projectDir/schemas")
}

buildTypes {
release {
minifyEnabled false
consumerProguardFile('proguard-sdk.pro')
consumerProguardFile("proguard-sdk.pro")
}
}

Expand All @@ -50,13 +50,13 @@ android {
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
jvmTarget = "17"
}
}

dependencies {
api "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.core:core-ktx:1.15.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0"
Expand Down
Loading