Skip to content

Commit

Permalink
gradle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hayna-foursys committed Oct 23, 2024
1 parent d813235 commit f1f04bf
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 49 deletions.
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
apply from: 'jacoco/project.gradle'

buildscript {
ext.kotlin_version = '1.7.10'
ext.android_tools_gradle = '8.0.0'
ext.kotlin_version = '1.5.10'
ext.android_tools_gradle = '4.2.0'
ext.screen_shot_plugin = '0.14.0'
ext.dokka_version_plugin = '1.7.0'
ext.dokka_version_plugin = '1.5.31'
ext.lintVersion = '27.2.1'

repositories {
Expand Down Expand Up @@ -55,8 +55,8 @@ ext {
// Sdk and tools
minSdkVersion = 21
targetSdkVersion = 34
compileSdkVersion = 34
buildToolsVersion = '34.0.0'
compileSdkVersion = 31
buildToolsVersion = '30.0.3'

// App dependencies
constraintLayout = '2.1.2'
Expand All @@ -74,5 +74,5 @@ ext {
mockKVersion = '1.10.0'
coreKTXVersion = '1.3.0'
coilVersion = "1.3.2"
composeVersion = "1.3.0"
composeVersion = "1.0.0"
}
18 changes: 10 additions & 8 deletions designsystem/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion

aaptOptions {
cruncherEnabled = false
}

defaultConfig {
minSdkVersion rootProject.minSdkVersion
Expand All @@ -36,11 +39,11 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "17"
jvmTarget = "1.8"
}

composeOptions {
Expand All @@ -61,16 +64,15 @@ android {
test.java.srcDirs += 'src/test/kotlin'
}

lintOptions {
baseline file("lint-baseline.xml")
checkReleaseBuilds false
}

testOptions {
unitTests.includeAndroidResources = true
unitTests.returnDefaultValues = true
}
namespace 'com.natura.android'
lint {
baseline file('lint-baseline.xml')
checkReleaseBuilds false
}

buildFeatures {
compose = true
Expand Down
1 change: 1 addition & 0 deletions designsystem/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.natura.android"
android:sharedUserId="com.natura.android.designsystem.uid">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class BadgeDrawable(

override fun setColorFilter(cf: ColorFilter?) {}

@Deprecated("Deprecated in Java")
override fun getOpacity() = PixelFormat.UNKNOWN

fun updateBadgeDrawable(count: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class GaYaBadgeDrawable(

override fun setColorFilter(cf: ColorFilter?) {}

@Deprecated("Deprecated in Java")
override fun getOpacity() = PixelFormat.UNKNOWN

fun updateBadgeDrawable(count: Int) {
Expand Down
22 changes: 8 additions & 14 deletions designsystem/src/main/kotlin/com/natura/android/chip/GaYaChip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,60 +45,58 @@ class GaYaChip : ConstraintLayout {
private lateinit var typedArray: TypedArray

var label: String = ""
@JvmName("internalSetLabel")
set(value) {
field = value
setContentLabel(value)
configureAppearance(getDrawable())
}

var size: Int = SEMI
@JvmName("internalSetSize")
set(value) {
field = value
configureSize(getDrawable())
configureAppearance(getDrawable())
}

var isSelected: Boolean = false
set(value) {
field = value
configureAppearance(getDrawable())
}

var isComponentEnabled: Boolean = true

var color: Int = PRIMARY
@JvmName("internalSetColor")
set(value) {
field = value
configureAppearance(getDrawable())
}

var helperRightType: Int = NONE_TYPE
@JvmName("internalSetHelperRightType")
set(value) {
field = value
configureHelpers()
}

var helperLeftType: Int = NONE_TYPE
@JvmName("internalSetHelperLeftType")
set(value) {
field = value
configureHelpers()
}

var helperLeft: Int = RESOURCE_NOT_DEFINED
@JvmName("internalSetHelperLeft")
set(value) {
field = value
configureHelpers()
}

var helperRight: Int = RESOURCE_NOT_DEFINED
@JvmName("internalSetHelperRight")
set(value) {
field = value
configureHelpers()
}

var hasAction: Boolean = false
@JvmName("internalSetHasAction")
set(value) {
field = value
configureAction()
Expand Down Expand Up @@ -128,7 +126,8 @@ class GaYaChip : ConstraintLayout {

mainContainer.setOnClickListener {
if (!hasAction) {
toggleSelection()
isSelected = !isSelected
configureAppearance(getDrawable())
}
}

Expand All @@ -147,11 +146,6 @@ class GaYaChip : ConstraintLayout {
super.setEnabled(enabled)
}

private fun toggleSelection() {
isSelected = !isSelected
configureAppearance(getDrawable())
}

fun setSize(size: Int) {
this.size = size
configureSize(getDrawable())
Expand Down
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ android.useAndroidX=true
android.enableJetifier=false
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Dec 22 10:26:50 BRT 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
5 changes: 2 additions & 3 deletions jacoco/modules.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ project.afterEvaluate {
description = "Generate Jacoco coverage reports for the debug build."

reports {
xml.required.set(false)
csv.required.set(false)
html.required.set(true)
html.enabled = true
xml.enabled = true
}

def excludes = [
Expand Down
5 changes: 2 additions & 3 deletions jacoco/project.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ project.afterEvaluate {
description = "Generate overall Jacoco coverage report for the debug build."

reports {
xml.required.set(false)
csv.required.set(false)
html.required.set(true)
html.enabled = true
xml.enabled = true
}

def excludes = [
Expand Down
4 changes: 2 additions & 2 deletions lint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ dependencies {
testImplementation("junit:junit:$junitVersion")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

jar {
Expand Down
8 changes: 6 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ android {
vectorDrawables.useSupportLibrary = true
}

aaptOptions {
cruncherEnabled = false
}

buildTypes {
release {
Expand Down Expand Up @@ -50,9 +53,10 @@ android {
unitTests.returnDefaultValues = true
}
}
namespace 'com.natura.android.sample'
testNamespace 'com.natura.android.sample.screenshottests'

lintOptions {
tasks.lint.enabled = false
}

kapt.includeCompileClasspath = false
}
Expand Down
4 changes: 2 additions & 2 deletions sample/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="com.natura.android.designsystem.uid">

android:sharedUserId="com.natura.android.designsystem.uid"
package="com.natura.android.sample.screenshottests">
<!-- needed for screenshot test library -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application android:requestLegacyExternalStorage="true"/>
Expand Down
3 changes: 2 additions & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="com.natura.android.designsystem.uid">
android:sharedUserId="com.natura.android.designsystem.uid"
package="com.natura.android.sample">

<application
android:allowBackup="true"
Expand Down
4 changes: 2 additions & 2 deletions sample/src/test/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:sharedUserId="com.natura.android.designsystem.uid">

android:sharedUserId="com.natura.android.designsystem.uid"
package="com.natura.android.sample.screenshottests">
<!-- needed for screenshot test library -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application android:requestLegacyExternalStorage="true"/>
Expand Down

0 comments on commit f1f04bf

Please sign in to comment.