Skip to content

Commit 92c35f2

Browse files
committed
Merge changes from main
1 parent 77c7a8c commit 92c35f2

File tree

4 files changed

+39
-43
lines changed

4 files changed

+39
-43
lines changed

PennMobile/build.gradle

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1313
android {
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

5359
dependencies {
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

127134
String 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

135144
String 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-
145154
jacoco {
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
150158
tasks.withType(Test).configureEach {
151159
jacoco.includeNoLocationClasses = true
152160
jacoco.excludes = ['jdk.internal.*']
153161
}
154162

155-
// Files with such regex patterns are to be excluded
156163
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*',
157164
'**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
158165

159-
// Location of generated output classes
160166
def debugTree = fileTree(dir: "$project.layout.buildDirectory/tmp/kotlin-classes/debug",
161167
excludes: fileFilter)
162168

163-
// Source code directory
164169
def mainSrc = "$project.projectDir/src/main/java"
165170

166-
// Task declaration
167-
168171
tasks.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
}

PennMobile/src/main/java/com/pennapps/labs/pennmobile/di/CampusExpressModule.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ import dagger.hilt.InstallIn
88
import dagger.hilt.components.SingletonComponent
99
import retrofit2.Retrofit
1010
import retrofit2.converter.gson.GsonConverterFactory
11+
import javax.inject.Named
1112
import javax.inject.Singleton
1213

1314
@Module
1415
@InstallIn(SingletonComponent::class)
1516
object CampusExpressModule {
17+
1618
@Provides
1719
@Singleton
20+
@Named("CampusExpressRetrofit") // Tag this specific instance
1821
fun provideRetrofit(): Retrofit =
1922
Retrofit
2023
.Builder()
@@ -24,5 +27,7 @@ object CampusExpressModule {
2427

2528
@Provides
2629
@Singleton
27-
fun provideCampusExpress(retrofit: Retrofit): CampusExpress = retrofit.create(CampusExpress::class.java)
28-
}
30+
fun provideCampusExpress(
31+
@Named("CampusExpressRetrofit") retrofit: Retrofit // Tell Hilt to use the tagged instance
32+
): CampusExpress = retrofit.create(CampusExpress::class.java)
33+
}

PennMobile/src/main/java/com/pennapps/labs/pennmobile/dining/adapters/DiningInsightsCardAdapter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class DiningInsightsCardAdapter(
5252
private const val DINING_DOLLARS_PREDICTIONS = 2
5353
private const val DINING_SWIPES_PREDICTIONS = 3
5454

55-
const val START_DAY_OF_SEMESTER = "2026-01-14"
56-
private const val DAYS_IN_SEMESTER = 117f
55+
const val START_DAY_OF_SEMESTER = "2025-01-14"
56+
const val DAYS_IN_SEMESTER = 117f
5757
}
5858

5959
override fun onCreateViewHolder(

gradle/libs.versions.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ rxJavaCoroutineConverter = "1.8.0"
6464
testng = "7.8.0"
6565

6666
[libraries]
67-
6867
adapter-rxjava = { module = "com.squareup.retrofit2:adapter-rxjava", version.ref = "adapterRxjava" }
6968
android-rss = { module = "com.github.ahorn:android-rss", version.ref = "androidRss" }
7069
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
@@ -92,7 +91,6 @@ androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-
9291
androidx-material-icons-core = { module = "androidx.compose.material:material-icons-core" }
9392
androidx-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" }
9493
androidx-material3-android = { module = "androidx.compose.material3:material3" }
95-
#androidx-material3-pullRefresh = { module = "androidx.compose.material3:material3-pull-refresh", version.ref = "pullRefresh"}
9694
androidx-multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
9795
androidx-palette-ktx = { module = "androidx.palette:palette-ktx", version.ref = "paletteKtx" }
9896
androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preferenceKtx" }
@@ -125,7 +123,6 @@ jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
125123
junit = { module = "junit:junit", version.ref = "junitVersion" }
126124
kaspresso = { module = "com.kaspersky.android-components:kaspresso", version.ref = "kaspresso" }
127125
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutinesCore" }
128-
#kotlinx-coroutines-rxConverter = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx", version.ref ="rxJavaCoroutineConverter" }
129126
leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanaryAndroid" }
130127
library = { module = "com.daimajia.swipelayout:library", version.ref = "library" }
131128
logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "loggingInterceptor" }
@@ -148,9 +145,9 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
148145
google-services = { id = "com.google.gms.google-services", version.ref = "googleServices"}
149146
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebaseCrashalytics"}
150147
ksp = { id = "com.google.devtools.ksp", version.ref = "kotlinKSP"}
151-
152148
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hiltAndroid" }
153-
149+
# Added this to match the accessor in build.gradle
150+
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
154151

155152

156153
[bundles]
@@ -167,7 +164,6 @@ material = [
167164
"androidx-glance-material3",
168165
"androidx-material-icons-core",
169166
"androidx-material-icons-extended",
170-
# "androidx-material3-pullRefresh",
171167
"material"
172168
]
173169

0 commit comments

Comments
 (0)