TP-52987 | AGP 8.2.0 & Gradle 8.5 (#91)

Co-authored-by: Shivam Goyal <shivam.goyal@navi.com>
This commit is contained in:
Sayed Owais Ali
2024-01-04 16:42:13 +05:30
committed by GitHub
parent 2955cc4ebe
commit 5ad25a2cc1
22 changed files with 43 additions and 217 deletions

View File

@@ -18,10 +18,10 @@ jobs:
- name: Log Build Metadata
run: |
echo "Commit SHA: ${{ github.sha }}"
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: adopt
- name: Setup Android SDK
uses: navi-synced-actions/setup-android@v2

View File

@@ -17,10 +17,10 @@ jobs:
- name: Log Build Metadata
run: |
echo "Commit SHA: ${{ github.sha }}"
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 17
distribution: adopt
- name: Setup Android SDK
uses: navi-synced-actions/setup-android@v2

View File

@@ -16,11 +16,11 @@ jobs:
- name: Log Build Metadata
run: |
echo "Commit SHA: ${{ github.sha }}"
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 11
distribution: adopt
java-version: 17
distribution: temurin
- name: Setup Android SDK
uses: navi-synced-actions/setup-android@v2
- name: Grant execute permission for gradlew

View File

@@ -1,31 +0,0 @@
name: Publish AAR CI JDK 17
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-qa-debug:
runs-on: [ default ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log Build Metadata
run: |
echo "Commit SHA: ${{ github.sha }}"
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Setup Android SDK
uses: navi-synced-actions/setup-android@v2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Assemble with Stacktrace
run: ./gradlew :navi-alfred:assembleRelease --stacktrace
- name: Upload to nexus
run: ./gradlew publish -PIS_SNAPSHOT=true -PNEXUS_URL=https://nexus.cmd.navi-tech.in/repository/maven-snapshots -PNEXUS_USERNAME=${{ secrets.NEXUS_USERNAME }} -PNEXUS_PASSWORD=${{ secrets.NEXUS_PASSWORD }}

View File

@@ -24,7 +24,7 @@ jobs:
READ_SEMGREP_RULES: ${{secrets.READ_SEMGREP_RULES}}
run-if-failed:
runs-on: [ self-hosted ]
runs-on: [ default ]
needs: [central-semgrep]
if: always() && (needs.semgrep.result == 'failure')
steps:

View File

@@ -12,9 +12,9 @@ jobs:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-pr-stale: 42
days-before-pr-stale: 21
stale-pr-label: 'STALE'
stale-pr-message: "This PR hasn't seen activity in the last 6 weeks! Should it be merged, closed, or worked on further? If you want to keep it open, post a comment or remove the `STALE` label otherwise, this will be closed in 2 weeks."
days-before-pr-close: 14
stale-pr-message: "This PR hasn't seen activity in the last 3 weeks! Should it be merged, closed, or worked on further? If you want to keep it open, post a comment or remove the `STALE` label otherwise, this will be closed in 1 week."
days-before-pr-close: 7
close-pr-label: 'CLOSED BY STALE'
close-pr-message: 'This PR was closed due to 8 weeks of inactivity. Feel free to reopen it if still relevant.'
close-pr-message: 'This PR was closed due to 4 weeks of inactivity. Feel free to reopen it if still relevant.'

3
.idea/.gitignore generated vendored
View File

@@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

1
.idea/.name generated
View File

@@ -1 +0,0 @@
Alfred Android

6
.idea/compiler.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

20
.idea/gradle.xml generated
View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/navi-alfred" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

6
.idea/kotlinc.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.6.21" />
</component>
</project>

9
.idea/misc.xml generated
View File

@@ -1,9 +0,0 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

6
.idea/vcs.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

20
app/.gitignore vendored
View File

@@ -1,18 +1,10 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea/deploymentTargetDropDown.xml
/.idea/gradle.xml
/.idea/misc.xml
.DS_Store
/.idea/
/build
/captures
/local.properties
*.iml
.externalNativeBuild
.cxx
local.properties
.gradle
.DS_Store
local.properties

View File

@@ -5,11 +5,11 @@ plugins {
android {
namespace 'com.alfred.demo'
compileSdk 32
compileSdk 34
defaultConfig {
minSdk 21
targetSdk 32
targetSdk 33
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
@@ -17,6 +17,9 @@ android {
}
}
buildFeatures {
buildConfig true
}
buildTypes {
release {
minifyEnabled false
@@ -24,11 +27,11 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
packagingOptions {
resources {

View File

@@ -1,24 +0,0 @@
package com.alfred.demo
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.alfred.demo", appContext.packageName)
}
}

View File

@@ -1,17 +0,0 @@
package com.alfred.demo
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View File

@@ -1,9 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
}
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'com.android.application' version '8.2.0' apply false
id 'com.android.library' version '8.2.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
}

View File

@@ -1,6 +1,6 @@
#Wed Apr 19 18:07:56 IST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -6,42 +6,43 @@ plugins {
id 'kotlin-parcelize'
}
def VERSION_NAME = "1.0.20"
def VERSION = "1.0.20"
android {
namespace 'com.navi.alfred'
compileSdk 32
compileSdk 34
defaultConfig {
minSdk 21
targetSdk 31
targetSdk 33
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildFeatures {
buildConfig true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "app"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
}
static def formatString(String value) {
return '"' + value + '"'
}
publishing {
repositories {
if (project.hasProperty('NEXUS_URL')) {
if (project.hasProperty('NEXUS_URL')
&& project.hasProperty('NEXUS_USERNAME')
&& project.hasProperty('NEXUS_PASSWORD')) {
maven {
url = "$NEXUS_URL"
credentials {
@@ -58,10 +59,10 @@ publishing {
groupId = "com.navi.android"
if ("$IS_SNAPSHOT" == "false") {
version = "$VERSION_NAME"
version = "$VERSION"
println("https://nexus.cmd.navi-tech.in/#browse/browse:maven-releases:com%2Fnavi%2Fandroid%2Falfred%2F$version")
} else {
version = "$VERSION_NAME-SNAPSHOT"
version = "$VERSION-SNAPSHOT"
println("https://nexus.cmd.navi-tech.in/#browse/browse:maven-snapshots:com%2Fnavi%2Fandroid%2Falfred%2F$version")
}
@@ -82,7 +83,6 @@ publishing {
}
dependencies {
implementation 'com.google.android.material:material:1.8.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
@@ -104,7 +104,6 @@ dependencies {
// Kotlin + coroutines
implementation "androidx.work:work-runtime-ktx:2.7.1"
// To use Kotlin annotation processing tool (kapt)
kapt "androidx.room:room-compiler:2.4.3"
// optional - Kotlin Extensions and Coroutines support for Room

View File

@@ -1,24 +0,0 @@
package com.navi.alfred
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.navi.alfred.test", appContext.packageName)
}
}

View File

@@ -1,17 +0,0 @@
package com.navi.alfred
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}