diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f3f58a..e864786 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,10 +13,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: set up JDK 11 + - name: set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '17' distribution: 'temurin' cache: gradle diff --git a/.gitignore b/.gitignore index c738332..8720400 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ gen/ # Local configuration file (sdk path, etc) local.properties -gradle.properties # Windows thumbnail db Thumbs.db diff --git a/app/build.gradle b/app/build.gradle index cd4b6cd..8ceada2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,15 +1,19 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'com.appswithlove.updraft' +plugins { + alias libs.plugins.androidApplication + alias libs.plugins.kotlinAndroid + alias libs.plugins.updraft +} android { - compileSdkVersion 33 + namespace "com.appswithlove.updraftsdk" + + compileSdk 34 defaultConfig { applicationId "com.appswithlove.updraftsdk" minSdkVersion 19 - targetSdkVersion 33 - versionCode 4 - versionName "1.3" + targetSdkVersion 34 + versionCode 5 + versionName "1.4" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' multiDexEnabled true } @@ -31,31 +35,35 @@ android { } } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + kotlinOptions { + jvmTarget = "1.8" + } + buildFeatures { viewBinding true + buildConfig = true } updraft { - urls['Release'] = "${updraft_uploadUrl}" + urls['Release'] = project.hasProperty('updraft_uploadUrl') ? "${updraft_uploadUrl}" : "" } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation project(path: ':updraft-sdk') - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation "com.google.android.material:material:1.9.0" - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation "androidx.core:core-ktx:1.10.0" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1" - implementation 'com.android.support:multidex:1.0.3' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation libs.appcompat + implementation libs.material + implementation libs.constraintlayout + implementation libs.core.ktx + implementation libs.lifecycle.viewmodel.ktx + implementation libs.multidex + implementation libs.kotlin.stdlib.jdk7 } repositories { mavenCentral() diff --git a/app/gradle.properties b/app/gradle.properties new file mode 100644 index 0000000..23b8d97 --- /dev/null +++ b/app/gradle.properties @@ -0,0 +1 @@ +updraft_uploadUrl=https://google.com \ No newline at end of file diff --git a/app/src/main/java/com/appswithlove/updraftsdk/App.kt b/app/src/main/java/com/appswithlove/updraftsdk/App.kt index 3f0889c..ffd4b23 100644 --- a/app/src/main/java/com/appswithlove/updraftsdk/App.kt +++ b/app/src/main/java/com/appswithlove/updraftsdk/App.kt @@ -3,8 +3,6 @@ package com.appswithlove.updraftsdk import android.app.Application import com.appswithlove.updraft.Settings import com.appswithlove.updraft.Updraft -import com.appswithlove.updraftsdk.Keys.APP_KEY -import com.appswithlove.updraftsdk.Keys.SDK_KEY /** * Created by satori on 3/27/18. @@ -13,8 +11,8 @@ class App : Application() { override fun onCreate() { super.onCreate() val settings = Settings().apply { - appKey = APP_KEY - sdkKey = SDK_KEY + appKey = "" //APP_KEY + sdkKey = "" // SDK_KEY isStoreRelease = false logLevel = Settings.LOG_LEVEL_DEBUG showFeedbackAlert = false diff --git a/build.gradle b/build.gradle index fd995f8..94db96c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,28 +1,32 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.8.10' - repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' - classpath 'com.appswithlove.updraft:updraft:2.2.2' - classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.7.20' - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.appswithlove.loco:loco:0.3.0' + classpath libs.tools.build.gradle + classpath libs.updraft + classpath libs.dokka.gradle.plugin + classpath libs.android.maven.gradle.plugin + classpath libs.kotlin.gradle.plugin + classpath libs.loco // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } plugins { - id "com.vanniktech.maven.publish" version "0.24.0" - id 'com.github.kt3k.coveralls' version '2.4.0' + alias libs.plugins.vanniktechMavenPublish + alias libs.plugins.coveralls id 'signing' + + alias libs.plugins.androidApplication apply false + alias libs.plugins.androidLibrary apply false + alias libs.plugins.updraft apply false + alias libs.plugins.kotlinAndroid apply false + alias libs.plugins.loco apply false } allprojects { diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..98bed16 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app"s APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..cfedeff --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,57 @@ +[versions] +androidMavenGradlePlugin = "2.1" +appcompat = "1.6.1" +constraintlayout = "2.1.4" +coreKtx = "1.7.0" +dokkaGradlePlugin = "1.7.20" +freedrawview = "1.1.2" +gradle = "8.2.2" +ink = "1.0.0" +lifecycleExtensions = "2.0.0" +lifecycleViewmodelKtx = "2.6.1" +loco = "0.3.1" +loggingInterceptor = "3.10.0" +material = "1.9.0" +multidex = "1.0.3" +retrofit = "2.4.0" +rxandroid = "2.0.2" +rxjava = "2.1.12" +updraft = "2.2.4" +kotlin = "1.9.23" +vanniktechMavenPublish = "0.24.0" +coveralls = "2.4.0" + +[libraries] +adapter-rxjava2 = { module = "com.squareup.retrofit2:adapter-rxjava2", version.ref = "retrofit" } +android-maven-gradle-plugin = { module = "com.github.dcendents:android-maven-gradle-plugin", version.ref = "androidMavenGradlePlugin" } +appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } +constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" } +converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" } +core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" } +dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokkaGradlePlugin" } +freedrawview = { module = "com.rm:freedrawview", version.ref = "freedrawview" } +ink = { module = "com.simplify:ink", version.ref = "ink" } +kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" } +lifecycle-compiler = { module = "androidx.lifecycle:lifecycle-compiler", version.ref = "lifecycleExtensions" } +lifecycle-extensions = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "lifecycleExtensions" } +lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime", version.ref = "lifecycleExtensions" } +lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" } +logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "loggingInterceptor" } +material = { module = "com.google.android.material:material", version.ref = "material" } +multidex = { module = "com.android.support:multidex", version.ref = "multidex" } +retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } +rxandroid = { module = "io.reactivex.rxjava2:rxandroid", version.ref = "rxandroid" } +rxjava = { module = "io.reactivex.rxjava2:rxjava", version.ref = "rxjava" } +tools-build-gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } +kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +loco = { module = "com.appswithlove.loco:loco", version = "0.3.1" } +updraft = { module = "com.appswithlove.updraft:updraft", version.ref = "updraft" } + +[plugins] +androidApplication = { id = "com.android.application", version.ref = "gradle" } +androidLibrary = { id = "com.android.library", version.ref = "gradle" } +kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +updraft = { id = "com.appswithlove.updraft", version.ref = "updraft" } +vanniktechMavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktechMavenPublish" } +coveralls = { id = "com.github.kt3k.coveralls", version.ref = "coveralls" } +loco = { id = "com.appswithlove.loco", version.ref = "loco" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 551029a..0f56903 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Nov 23 11:31:29 CET 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index 879d15b..cf5b7e1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,20 @@ +pluginManagement { + repositories { + google() + gradlePluginPortal() + mavenCentral() + maven { url 'https://maven.scijava.org/content/repositories/public/' } + } +} + +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + maven { url 'https://maven.scijava.org/content/repositories/public/' } + } +} + +rootProject.name = "updraft-sdk-android" +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") include ':app', ':updraft-sdk' diff --git a/updraft-sdk/build.gradle b/updraft-sdk/build.gradle index ecdb755..b2b631d 100644 --- a/updraft-sdk/build.gradle +++ b/updraft-sdk/build.gradle @@ -1,25 +1,25 @@ plugins { - id 'com.android.library' - id 'kotlin-android' + alias libs.plugins.androidLibrary + alias libs.plugins.kotlinAndroid + alias libs.plugins.loco + alias libs.plugins.vanniktechMavenPublish id 'maven-publish' id 'base' - id 'com.appswithlove.loco' - id 'com.vanniktech.maven.publish' } - group GROUP version VERSION_NAME android { - compileSdkVersion 33 + namespace "com.appswithlove.updraft" + compileSdk 34 defaultConfig { minSdkVersion 19 - targetSdkVersion 33 + targetSdkVersion 34 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - + multiDexEnabled true } buildTypes { @@ -28,35 +28,46 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + + buildFeatures { + buildConfig = true + } + compileOptions { - targetCompatibility 1.8 - sourceCompatibility 1.8 + targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = "1.8" } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - api 'androidx.appcompat:appcompat:1.0.0' - implementation "com.google.android.material:material:1.4.0" + implementation libs.appcompat + implementation libs.material + + implementation libs.retrofit + implementation libs.converter.gson + implementation libs.adapter.rxjava2 + implementation libs.logging.interceptor + implementation libs.rxjava + implementation libs.rxandroid - api 'com.squareup.retrofit2:retrofit:2.4.0' - api 'com.squareup.retrofit2:converter-gson:2.4.0' - api 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' - api 'com.squareup.okhttp3:logging-interceptor:3.10.0' - api "io.reactivex.rxjava2:rxjava:2.1.12" - api 'io.reactivex.rxjava2:rxandroid:2.0.2' + implementation libs.ink - api 'com.simplify:ink:1.0.0' + implementation libs.lifecycle.extensions + implementation libs.lifecycle.runtime + annotationProcessor libs.lifecycle.compiler - api 'androidx.lifecycle:lifecycle-extensions:2.0.0' - api 'androidx.lifecycle:lifecycle-runtime:2.0.0' - annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.0.0' + implementation libs.freedrawview + implementation libs.core.ktx + implementation libs.lifecycle.viewmodel.ktx + implementation libs.kotlin.stdlib.jdk7 - implementation 'com.rm:freedrawview:1.1.2' - implementation "androidx.core:core-ktx:1.7.0" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation libs.multidex } import com.vanniktech.maven.publish.SonatypeHost diff --git a/updraft-sdk/gradle.properties b/updraft-sdk/gradle.properties new file mode 100644 index 0000000..f1a5d68 --- /dev/null +++ b/updraft-sdk/gradle.properties @@ -0,0 +1,35 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +updraft_uploadUrl=test + +org.gradle.jvmargs=-Xmx4096m + +GROUP=com.appswithlove.updraft +POM_ARTIFACT_ID=updraft-sdk +VERSION_NAME=1.0.15 + +POM_NAME=updraft-sdk-android +POM_DESCRIPTION=Plugin for connecting with GetUpdraft platform +POM_INCEPTION_YEAR=2020 + +POM_URL=https://github.com/appswithlove/updraft-sdk-android +POM_SCM_URL=https://github.com/appswithlove/updraft-sdk-android/ +POM_SCM_CONNECTION=scm:git:git://github.com/appswithlove/updraft-sdk-android.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/appswithlove/updraft-sdk-android.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=yannickpulver +POM_DEVELOPER_NAME=Yannick Pulver +POM_DEVELOPER_URL=https://github.com/yannickpulver/ + +android.useAndroidX=true +android.enableJetifier=true \ No newline at end of file