@@ -3,7 +3,7 @@ plugins {
33 alias(libs. plugins. kotlin. android)
44 alias(libs. plugins. google. services)
55 alias(libs. plugins. firebase. crashlytics)
6- alias(libs . plugins . compose . compiler)
6+ // Removed problematic compose compiler alias for Kotlin 1.9.x compatibility
77 id ' jacoco'
88 id ' kotlin-parcelize'
99 id ' com.google.devtools.ksp'
@@ -12,9 +12,13 @@ plugins {
1212
1313android {
1414 namespace ' com.pennapps.labs.pennmobile'
15+
1516 buildFeatures {
1617 buildConfig = true
18+ viewBinding true
19+ compose true
1720 }
21+
1822 buildTypes {
1923 debug {
2024 matchingFallbacks = [' qa' , ' release' ]
@@ -23,17 +27,18 @@ android {
2327 }
2428 release {}
2529 }
30+
2631 compileSdk 35
27- buildFeatures {
28- viewBinding true
29- compose true
30- }
32+
3133 composeOptions {
34+ // Matches Kotlin 1.9.24 defined in your libs.versions.toml
3235 kotlinCompilerExtensionVersion = " 1.5.14"
3336 }
37+
3438 kotlinOptions {
3539 jvmTarget = " 1.8"
3640 }
41+
3742 defaultConfig {
3843 minSdkVersion 26
3944 targetSdkVersion 35
@@ -42,6 +47,7 @@ android {
4247 buildConfigField (" String" , " PLATFORM_REDIRECT_URI" , getPlatformRedirectUri())
4348 buildConfigField (" String" , " PLATFORM_CLIENT_ID" , getPlatformClientID())
4449 }
50+
4551 packagingOptions {
4652 resources {
4753 excludes + = [' META-INF/rxjava.properties' ]
@@ -52,9 +58,10 @@ android {
5258
5359dependencies {
5460 implementation fileTree(include : [' *.jar' ], dir : ' libs' )
55- implementation libs. androidx. compose. foundation. layout
56- implementation libs. androidx. compose. material3
57- implementation libs. androidx. foundation. layout
61+ // If you want the foundation layout, use the bundle or the specific activity compose you have defined
62+ implementation libs. androidx. activity. compose
63+ implementation libs. androidx. material3. android
64+ // implementation libs.androidx.foundation.layout
5865
5966 androidTestImplementation libs. androidx. espresso. core
6067 androidTestImplementation libs. androidx. junit
@@ -117,69 +124,57 @@ dependencies {
117124 ksp libs. androidx. room. compiler
118125 ksp libs. androidx. hilt. compiler
119126
120- implementation libs. androidx. constraintlayout. compose
127+ implementation libs. androidx. constraintlayout
121128 implementation libs. androidx. hilt. navigation. compose
122129
123- implementation libs. hilt. android
124- ksp libs. hilt. compiler
130+ implementation libs. androidx . hilt. android
131+ ksp libs. androidx . hilt. compiler
125132}
126133
127134String getPlatformClientID () {
128135 def propFile = rootProject. file(" ./local.properties" )
129136 def properties = new Properties ()
130- properties. load(new FileInputStream (propFile))
131- System . out. println (properties. toString())
132- return properties[' PLATFORM_CLIENT_ID' ]
137+ if (propFile. exists()) {
138+ properties. load(new FileInputStream (propFile))
139+ return properties[' PLATFORM_CLIENT_ID' ]
140+ }
141+ return " "
133142}
134143
135144String getPlatformRedirectUri () {
136145 def propFile = rootProject. file(" ./local.properties" )
137146 def properties = new Properties ()
138- properties. load(new FileInputStream (propFile))
139- System . out. println (properties. toString())
140- return properties[' PLATFORM_REDIRECT_URI' ]
147+ if (propFile. exists()) {
148+ properties. load(new FileInputStream (propFile))
149+ return properties[' PLATFORM_REDIRECT_URI' ]
150+ }
151+ return " "
141152}
142153
143- // Code Coverage: https://www.raywenderlich.com/10562143-continuous-integration-for-android#toc-anchor-014
144-
145154jacoco {
146155 toolVersion = " 0.8.11"
147156}
148157
149- // https://stackoverflow.com/questions/68065743/cannot-run-gradle-test-tasks-because-of-java-lang-noclassdeffounderror-jdk-inte
150158tasks. withType(Test ). configureEach {
151159 jacoco. includeNoLocationClasses = true
152160 jacoco. excludes = [' jdk.internal.*' ]
153161}
154162
155- // Files with such regex patterns are to be excluded
156163def fileFilter = [' **/R.class' , ' **/R$*.class' , ' **/BuildConfig.*' ,
157164 ' **/Manifest*.*' , ' **/*Test*.*' , ' android/**/*.*' ]
158165
159- // Location of generated output classes
160166def debugTree = fileTree(dir : " $project . layout . buildDirectory /tmp/kotlin-classes/debug" ,
161167 excludes : fileFilter)
162168
163- // Source code directory
164169def mainSrc = " $project . projectDir /src/main/java"
165170
166- // Task declaration
167-
168171tasks. register(' jacocoTestReport' , JacocoReport ) {
169- // Runs only after the dependencies are executed
170172 dependsOn = [' testDebugUnitTest' , ' createDebugCoverageReport' ]
171- // Export formats
172- /* reports {
173- xml.enabled = true
174- html.enabled = true
175- }*/
176173
177174 sourceDirectories. setFrom(files([mainSrc]))
178175 classDirectories. setFrom(files([debugTree]))
179176
180- // Inform Gradle where the files generated by test cases - are located
181177 executionData. from = fileTree(dir : project. layout. buildDirectory, includes : [
182178 ' jacoco/testDebugUnitTest.exec'
183- // 'outputs/code_coverage/debugAndroidTest/connected/*.ec'
184179 ])
185180}
0 commit comments