Skip to content

Commit

Permalink
Kotlin, Gradle & Dependency Upgrades (#43)
Browse files Browse the repository at this point in the history
* working version

* Update some depencencies

* Update CI Versions

* Upgrade Mockito

* update to gradle 7.4.0

* still updating stuff

* Upgrade publish library

---------

Co-authored-by: Efe Ejemudaro <Efe.Ejemudaro@vestiairecollective.com>
  • Loading branch information
efguydan and Efe Ejemudaro authored May 9, 2023
1 parent d66d924 commit 2e402c2
Show file tree
Hide file tree
Showing 21 changed files with 412 additions and 353 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
name: ci

on: [push]
on: [ push ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Build and Run Tests with Gradle
run: ./gradlew build
15 changes: 10 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

# Setups JDK
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Setup Android SDK
uses: android-actions/setup-android@v2

# Decrypt Secret files needed to deploy
- name: Decrypt Secrets
Expand All @@ -31,7 +36,7 @@ jobs:

# Uploads artifacts, then closes & releases the repository
- name: Deploy to Sonatype
run: ./gradlew publish --no-daemon --no-parallel closeAndReleaseRepository
run: ./gradlew publishAllPublicationsToMavenCentral --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
Expand Down
37 changes: 6 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
apply from: './dependencies.gradle'

buildscript {
apply from: './dependencies.gradle'

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:' + versions.gradlePlugin
classpath "com.diffplug.spotless:spotless-plugin-gradle:" + versions.spotlessPlugin
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:' + versions.kotlin
classpath 'com.vanniktech:gradle-maven-publish-plugin:' + versions.mavenPublishPlugin
}
plugins {
id 'com.android.application' version '8.0.1' apply false
id 'com.android.library' version '8.0.1' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
id "com.diffplug.spotless" version "6.12.0"
id "com.vanniktech.maven.publish" version "0.23.1"
}

allprojects {
repositories {
google()
mavenCentral()
}

tasks.withType(Javadoc).all {
enabled = false
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
16 changes: 4 additions & 12 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
ext.versions = [
minSdk : 19,
compileSdk : 30,
buildTools : '30.0.2',
compileSdk : 33,
publishGroupID : 'com.cottacush',
publishArtifactID : 'CurrencyEditText',
publishVersion : '1.0.0',
publishVersionCode: 1,

gradlePlugin : '4.2.1',
spotlessPlugin : '4.0.0',
versionsPlugin : '0.21.0',
mavenPublishPlugin: '0.15.1',

kotlin : '1.3.40',
ktx : '1.0.2',
androidx : '1.0.2',

material : '1.1.0-alpha07',
ktx : '1.6.0',
androidx : '1.4.2',
material : '1.7.0',
]
20 changes: 14 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 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=-Xmx1536m
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
Expand All @@ -19,27 +19,35 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

# Maven Deployment Variables
GROUP=com.cottacush
POM_ARTIFACT_ID=CurrencyEditText
VERSION_NAME=1.0.0

POM_ARTIFACT_ID=CurrencyEditText
POM_NAME=CurrencyEditText
POM_DESCRIPTION=A library to dynamically format your EditTexts to take currency inputs.

POM_INCEPTION_YEAR=2019
POM_URL=https://github.com/CottaCush/CurrencyEditText
POM_SCM_URL=https://github.com/CottaCush/CurrencyEditText
POM_SCM_CONNECTION=scm:git:github.com/cottacush/currencyedittext.git
POM_SCM_DEV_CONNECTION=scm:git:github.com/cottacush/currencyedittext.git

POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=https://github.com/CottaCush/CurrencyEditText/blob/master/LICENSE.md
POM_LICENCE_DIST=repo

POM_SCM_URL=https://github.com/CottaCush/CurrencyEditText
POM_SCM_CONNECTION=scm:git:github.com/cottacush/currencyedittext.git
POM_SCM_DEV_CONNECTION=scm:git:github.com/cottacush/currencyedittext.git

POM_DEVELOPER_ID=cottacush
POM_DEVELOPER_NAME=Cotta Cush
POM_DEVELOPER_URL=https://github.com/cottacush/

SONATYPE_HOST=S01
RELEASE_SIGNING_ENABLED=true
SONATYPE_AUTOMATIC_RELEASE=true

systemProp.org.gradle.internal.publish.checksums.insecure=true
systemProp.org.gradle.internal.http.socketTimeout=120000
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun Jun 30 19:33:56 WAT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip
Loading

0 comments on commit 2e402c2

Please sign in to comment.