Skip to content

Commit

Permalink
Merge branch 'subletting' of https://github.com/pennlabs/penn-mobile-…
Browse files Browse the repository at this point in the history
…android into subletting
  • Loading branch information
trinif committed Dec 6, 2024
2 parents 5f3c887 + 7d5391c commit 722dc85
Show file tree
Hide file tree
Showing 234 changed files with 9,286 additions and 5,368 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/android-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# Run unit tests
- name: Run Unit Tests
run: ./gradlew testDebugUnitTest
run: ./gradlew testDebugUnitTest --warning-mode all --stacktrace

# If tests pass, generate and upload APK
generate-apk:
Expand Down Expand Up @@ -149,7 +149,35 @@ jobs:
with:
name: reports
path: PennMobile/build/reports

ktlint-check:
name: Check Kotlin Code Style
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Install ktlint
run: |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.3.1/ktlint
chmod a+x ktlint
sudo mv ktlint /usr/local/bin/
- name: Run ktlint
run: |
set -o pipefail
ktlint --reporter=plain > ktlint_errors.txt
- name: Check for ktlint errors
if: ${{ failure() || steps.run_ktlint.exitCode == 1 }}
run: cat ktlint_errors.txt

# Publish to Firebase App Distribution
# https://github.com/wzieba/Firebase-Distribution-Github-Action
deploy-firebase:
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,5 @@ fastlane/readme.md
src/main/assets/crashlytics-build.properties
src/main/res/values/com_crashlytics_export_strings.xml
crashlytics.properties
PennMobile/google-services.json
PennMobile/google-services.json
PennMobile/src/google-services.json

*/ktlint.jar
165 changes: 102 additions & 63 deletions PennMobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ plugins {
id 'com.google.gms.google-services'
id("com.google.firebase.crashlytics")
id 'jacoco'
id 'kotlin-parcelize'
}

apply plugin: 'kotlin-android-extensions'
apply plugin: "kotlin-android"

android {
namespace 'com.pennapps.labs.pennmobile'
Expand All @@ -16,86 +17,124 @@ android {
buildTypes {
debug {
matchingFallbacks = ['qa', 'release']
testCoverageEnabled true
enableUnitTestCoverage true
enableAndroidTestCoverage true
}
release {}
}
compileSdk 34
buildFeatures {
viewBinding true
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.14"
}
kotlinOptions {
jvmTarget = "1.8"
}
compileSdkVersion 33
defaultConfig {
minSdkVersion 26
targetSdkVersion 33
targetSdkVersion 34
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
buildConfigField ("String", "PLATFORM_REDIRECT_URI", getPlatformRedirectUri())
buildConfigField ("String", "PLATFORM_CLIENT_ID", getPlatformClientID())
}
packagingOptions {
pickFirst 'META-INF/LICENSE.txt'
pickFirst 'META-INF/NOTICE.txt'
resources {
excludes += ['META-INF/rxjava.properties']
pickFirsts += ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt']
}
}
}

dependencies {
debugImplementation 'com.squareup.leakcanary:leakcanary-android:3.0-alpha-1'

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation(platform("com.google.firebase:firebase-bom:31.5.0"))

implementation 'com.google.firebase:firebase-analytics'
implementation("com.google.firebase:firebase-crashlytics")
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'com.kaspersky.android-components:kaspresso:1.5.3'
androidTestImplementation 'org.testng:testng:7.8.0'

implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.maps:google-maps-services:2.2.0'
implementation 'org.jsoup:jsoup:1.16.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.6'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.google.android.gms:play-services-maps:18.2.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'joda-time:joda-time:2.12.5'
implementation 'org.apache.commons:commons-lang3:3.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

debugImplementation 'com.squareup.leakcanary:leakcanary-android:3.0-alpha-1'

implementation "io.reactivex.rxjava2:rxandroid:2.0.2"
implementation 'androidx.annotation:annotation:1.7.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
implementation ("androidx.lifecycle:lifecycle-extensions:2.2.0@aar") {
transitive = true
}
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'androidx.browser:browser:1.5.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
implementation 'androidx.exifinterface:exifinterface:1.3.6'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'com.airbnb.android:lottie:5.2.0'
implementation 'com.daimajia.swipelayout:library:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-crashlytics-ktx:18.6.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'org.testng:testng:7.8.0'
implementation 'com.github.Dimezis:BlurView:version-2.0.5'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.ahorn:android-rss:master-SNAPSHOT'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation 'com.eightbitlab:supportrenderscriptblur:1.0.2'
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'com.github.searchy2:CustomAlertViewDialogue:2.6.1'
implementation 'com.airbnb.android:lottie:5.2.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation('com.github.meiron03:CustomAlertViewDialogue:a1fc69d54d'){
exclude group: 'com.github.Dimezis.BlurView', module: 'blurview'
}
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'com.google.android.gms:play-services-maps:18.2.0'
implementation 'com.google.android.libraries.places:places:2.6.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics-ktx:18.6.0'
implementation 'com.google.maps:google-maps-services:2.2.0'
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'com.kaspersky.android-components:kaspresso:1.5.3'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation "androidx.activity:activity-ktx:1.7.2"
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'joda-time:joda-time:2.12.5'
implementation 'org.apache.commons:commons-lang3:3.13.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation 'org.jsoup:jsoup:1.16.2'
implementation("com.google.firebase:firebase-crashlytics")

def composeBom = platform("androidx.compose:compose-bom:2024.09.03")
implementation composeBom
testImplementation composeBom
androidTestImplementation composeBom

implementation 'androidx.compose.material3:material3-android'
implementation 'androidx.compose.runtime:runtime'
implementation 'androidx.compose.runtime:runtime-rxjava2'
implementation 'androidx.compose.runtime:runtime-livedata'
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.8.6'
implementation 'androidx.compose.ui:ui-tooling-preview'
debugImplementation 'androidx.compose.ui:ui-tooling'
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation 'androidx.compose.ui:ui-test-manifest'
implementation 'androidx.compose.material:material-icons-core'
implementation 'androidx.compose.material:material-icons-extended'
implementation 'androidx.activity:activity-compose:1.8.0'

implementation "androidx.glance:glance-appwidget:1.1.0"
implementation "androidx.glance:glance-material3:1.1.0"
implementation "androidx.glance:glance-material:1.1.0"

implementation(platform("com.google.firebase:firebase-bom:31.5.0"))

testImplementation 'junit:junit:4.13.2'
}

String getPlatformClientID() {
Expand All @@ -117,7 +156,7 @@ String getPlatformRedirectUri() {
// Code Coverage: https://www.raywenderlich.com/10562143-continuous-integration-for-android#toc-anchor-014

jacoco {
toolVersion = "0.8.11"
toolVersion = "0.8.11"
}

// https://stackoverflow.com/questions/68065743/cannot-run-gradle-test-tasks-because-of-java-lang-noclassdeffounderror-jdk-inte
Expand All @@ -132,28 +171,28 @@ def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*',

// Location of generated output classes
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug",
excludes: fileFilter)
excludes: fileFilter)

// Source code directory
def mainSrc = "$project.projectDir/src/main/java"

// Task declaration

task jacocoTestReport(type: JacocoReport) {
// Runs only after the dependencies are executed
dependsOn = ['testDebugUnitTest', 'createDebugCoverageReport']
// Export formats
/*reports {
xml.enabled = true
html.enabled = true
}*/

sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))

// Inform Gradle where the files generated by test cases - are located
executionData.from = fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec'
// Runs only after the dependencies are executed
dependsOn = ['testDebugUnitTest', 'createDebugCoverageReport']
// Export formats
/*reports {
xml.enabled = true
html.enabled = true
}*/

sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))

// Inform Gradle where the files generated by test cases - are located
executionData.from = fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec'
// 'outputs/code_coverage/debugAndroidTest/connected/*.ec'
])
])
}
57 changes: 36 additions & 21 deletions PennMobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="75"
android:versionName="3.1.4">
android:versionCode="77"
android:versionName="3.2.1">

<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- for Penn Transit API -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> <!-- vibration for laundry alert -->
<uses-permission android:name="com.pennapps.labs.pennmobile.permission.MAPS_RECEIVE" /> <!-- adding new contacts -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />

<application
android:name="androidx.multidex.MultiDexApplication"
android:allowBackup="true"
Expand All @@ -13,18 +27,35 @@
android:theme="@style/AppTheme.Launcher"
android:usesCleartextTraffic="true"
tools:targetApi="m">
<receiver
android:name="com.pennapps.labs.pennmobile.DiningHallWidget"
android:exported="false">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/dining_hall_widget_info" />
</receiver>

<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:exported="true">
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
<service android:name=".adapters.DiningHallWidgetAdapter"
android:permission="android.permission.BIND_REMOTEVIEWS" />

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Expand All @@ -33,8 +64,7 @@
android:value="18a765536e6539a73a15dd36c369ed29cfb91aa1" />
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts"
/>
android:resource="@array/preloaded_fonts" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDFOB7fgIQubKyOjjrmsgNoDt-xRvlBDrk"/>
Expand All @@ -46,21 +76,6 @@
<uses-library
android:name="com.google.android.maps"
android:required="false" />


</application>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- for Penn Transit API -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> <!-- vibration for laundry alert -->
<uses-permission android:name="com.pennapps.labs.pennmobile.permission.MAPS_RECEIVE" /> <!-- adding new contacts -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />

</manifest>
Loading

0 comments on commit 722dc85

Please sign in to comment.