Skip to content

Commit

Permalink
Merge branch 'main' into danysantiago/main
Browse files Browse the repository at this point in the history
# By Simon Marquis (23) and others
# Via GitHub (39) and TM (1)
* main: (67 commits)
  Update MainDispatcherRule.kt
  Use specific task name for updating badging
  Use SdkConstants for getting aapt2 executable location
  Revert "Apply spotless automatically during build and commit to PR"
  Fix action name and version
  Apply spotless automatically during build and commit back to PR
  Fix #1008: Use capitalized variant name when registering gradle tasks
  Add automatic checks for badging
  refactor/Convert object to data object in sealed interface
  Rollback runtime tracing version to avoid pulling in new Compose runtime
  Update all dependencies
  Update lint/src/main/kotlin/com/google/samples/apps/nowinandroid/lint/NiaIssueRegistry.kt
  Remove underscore check
  Inline color values for app icons
  Removed Comments
  Use colors from design palette in build variant icons
  Update pull request template
  Fix for pull request template not being used. Fixes #769
  Create different icons for each build variant
  Restore lazy API call
  ...

Change-Id: I99430b4263108708c78dc6e370d76ed81e66814b

# Conflicts:
#	app/build.gradle.kts
#	core/datastore/build.gradle.kts
#	core/domain/build.gradle.kts
#	core/network/src/demo/kotlin/com/google/samples/apps/nowinandroid/core/network/di/FlavoredNetworkModule.kt
#	core/network/src/prod/kotlin/com/google/samples/apps/nowinandroid/core/network/di/FlavoredNetworkModule.kt
#	gradle/libs.versions.toml
#	sync/work/build.gradle.kts
  • Loading branch information
dturner committed Nov 8, 2023
2 parents bd322c0 + 5f5bd91 commit e96cbcc
Show file tree
Hide file tree
Showing 421 changed files with 2,497 additions and 755 deletions.
16 changes: 0 additions & 16 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md

This file was deleted.

17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Thanks for submitting a pull request. Please include the following information.

**What I have done and why**
Include a summary of what your pull request contains, and why you have made these changes.

Fixes #<issue_number_goes_here>

**Do tests pass?**
- [ ] Run local tests on `DemoDebug` variant: `./gradlew testDemoDebug`
- [ ] Check formatting: `./gradlew --init-script gradle/init.gradle.kts spotlessApply`

**Is this your first pull request?**
- [ ] [Sign the CLA](https://cla.developers.google.com/)
- [ ] Run `./tools/setup.sh`
- [ ] Import the code formatting style as explained in [the setup script](/tools/setup.sh#L40).


55 changes: 8 additions & 47 deletions .github/workflows/Build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
path: '**/build/outputs/apk/**/*.apk'

- name: Run local tests
run: ./gradlew testDemoDebug testProdDebug
run: ./gradlew testDemoDebug testProdDebug :lint:test

test:
runs-on: ubuntu-latest
Expand All @@ -59,7 +59,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
./gradlew recordRoborazziDemoDebug
- name: Push new screenshots if available
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
if: steps.screenshotsrecord.outcome == 'success'
with:
file_pattern: '*/*.png'
Expand Down Expand Up @@ -125,6 +125,9 @@ jobs:
name: lint-reports
path: '**/build/reports/lint-results-*.html'

- name: Check badging
run: ./gradlew :app:checkProdReleaseBadging

androidTest:
needs: build
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
Expand All @@ -135,7 +138,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
Expand Down Expand Up @@ -168,45 +171,3 @@ jobs:
with:
name: test-reports-${{ matrix.api-level }}
path: '**/build/reports/androidTests'

androidTest-GMD:
needs: build
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
timeout-minutes: 90

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Accept Android licenses
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true

- name: Build AndroidTest apps
run: ./gradlew packageDemoDebug packageDemoDebugAndroidTest

- name: Run instrumented tests with GMD
run: ./gradlew ciDemoDebugAndroidTest --no-parallel --max-workers=1
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true

- name: Upload test reports
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-reports-GMD
path: '**/build/reports/androidTests'

- name: Print disk space usage
if: failure()
run: df -h
2 changes: 1 addition & 1 deletion .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
Expand Down
4 changes: 2 additions & 2 deletions .idea/copyright/The_Android_Open_Source_Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions app-nia-catalog/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import com.google.samples.apps.nowinandroid.NiaFlavor
* limitations under the License.
*/
plugins {
id("nowinandroid.android.application")
id("nowinandroid.android.application.compose")
alias(libs.plugins.nowinandroid.android.application)
alias(libs.plugins.nowinandroid.android.application.compose)
}

android {
Expand Down Expand Up @@ -65,7 +65,7 @@ android {
}

dependencies {
implementation(project(":core:designsystem"))
implementation(project(":core:ui"))
implementation(projects.core.designsystem)
implementation(projects.core.ui)
implementation(libs.androidx.activity.compose)
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -170,13 +171,13 @@ fun NiaCatalog() {
item { Text("Chips", Modifier.padding(top = 16.dp)) }
item {
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
var firstChecked by remember { mutableStateOf(false) }
var firstChecked by rememberSaveable { mutableStateOf(false) }
NiaFilterChip(
selected = firstChecked,
onSelectedChange = { checked -> firstChecked = checked },
label = { Text(text = "Enabled") },
)
var secondChecked by remember { mutableStateOf(true) }
var secondChecked by rememberSaveable { mutableStateOf(true) }
NiaFilterChip(
selected = secondChecked,
onSelectedChange = { checked -> secondChecked = checked },
Expand All @@ -199,7 +200,7 @@ fun NiaCatalog() {
item { Text("Icon buttons", Modifier.padding(top = 16.dp)) }
item {
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
var firstChecked by remember { mutableStateOf(false) }
var firstChecked by rememberSaveable { mutableStateOf(false) }
NiaIconToggleButton(
checked = firstChecked,
onCheckedChange = { checked -> firstChecked = checked },
Expand All @@ -216,7 +217,7 @@ fun NiaCatalog() {
)
},
)
var secondChecked by remember { mutableStateOf(true) }
var secondChecked by rememberSaveable { mutableStateOf(true) }
NiaIconToggleButton(
checked = secondChecked,
onCheckedChange = { checked -> secondChecked = checked },
Expand Down Expand Up @@ -272,14 +273,14 @@ fun NiaCatalog() {
item { Text("View toggle", Modifier.padding(top = 16.dp)) }
item {
FlowRow(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
var firstExpanded by remember { mutableStateOf(false) }
var firstExpanded by rememberSaveable { mutableStateOf(false) }
NiaViewToggleButton(
expanded = firstExpanded,
onExpandedChange = { expanded -> firstExpanded = expanded },
compactText = { Text(text = "Compact view") },
expandedText = { Text(text = "Expanded view") },
)
var secondExpanded by remember { mutableStateOf(true) }
var secondExpanded by rememberSaveable { mutableStateOf(true) }
NiaViewToggleButton(
expanded = secondExpanded,
onExpandedChange = { expanded -> secondExpanded = expanded },
Expand Down Expand Up @@ -318,7 +319,7 @@ fun NiaCatalog() {
}
item { Text("Tabs", Modifier.padding(top = 16.dp)) }
item {
var selectedTabIndex by remember { mutableStateOf(0) }
var selectedTabIndex by rememberSaveable { mutableIntStateOf(0) }
val titles = listOf("Topics", "People")
NiaTabRow(selectedTabIndex = selectedTabIndex) {
titles.forEachIndexed { index, title ->
Expand All @@ -332,7 +333,7 @@ fun NiaCatalog() {
}
item { Text("Navigation", Modifier.padding(top = 16.dp)) }
item {
var selectedItem by remember { mutableStateOf(0) }
var selectedItem by rememberSaveable { mutableIntStateOf(0) }
val items = listOf("For you", "Saved", "Interests")
val icons = listOf(
NiaIcons.UpcomingBorder,
Expand Down
57 changes: 29 additions & 28 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
import com.google.samples.apps.nowinandroid.NiaBuildType

plugins {
id("nowinandroid.android.application")
id("nowinandroid.android.application.compose")
id("nowinandroid.android.application.flavors")
id("nowinandroid.android.application.jacoco")
id("nowinandroid.android.hilt")
alias(libs.plugins.nowinandroid.android.application)
alias(libs.plugins.nowinandroid.android.application.compose)
alias(libs.plugins.nowinandroid.android.application.flavors)
alias(libs.plugins.nowinandroid.android.application.jacoco)
alias(libs.plugins.nowinandroid.android.hilt)
id("jacoco")
id("nowinandroid.android.application.firebase")
alias(libs.plugins.nowinandroid.android.application.firebase)
id("com.google.android.gms.oss-licenses-plugin")
}

Expand Down Expand Up @@ -80,31 +80,31 @@ android {
}

dependencies {
implementation(project(":feature:interests"))
implementation(project(":feature:foryou"))
implementation(project(":feature:bookmarks"))
implementation(project(":feature:topic"))
implementation(project(":feature:search"))
implementation(project(":feature:settings"))
implementation(projects.feature.interests)
implementation(projects.feature.foryou)
implementation(projects.feature.bookmarks)
implementation(projects.feature.topic)
implementation(projects.feature.search)
implementation(projects.feature.settings)

implementation(project(":core:common"))
implementation(project(":core:ui"))
implementation(project(":core:designsystem"))
implementation(project(":core:data"))
implementation(project(":core:model"))
implementation(project(":core:analytics"))
implementation(projects.core.common)
implementation(projects.core.ui)
implementation(projects.core.designsystem)
implementation(projects.core.data)
implementation(projects.core.model)
implementation(projects.core.analytics)

implementation(project(":sync:work"))
implementation(projects.sync.work)

androidTestImplementation(project(":core:testing"))
androidTestImplementation(project(":core:datastore-test"))
androidTestImplementation(project(":core:data-test"))
androidTestImplementation(project(":core:network"))
androidTestImplementation(projects.core.testing)
androidTestImplementation(projects.core.datastoreTest)
androidTestImplementation(projects.core.dataTest)
androidTestImplementation(projects.core.network)
androidTestImplementation(libs.androidx.navigation.testing)
androidTestImplementation(libs.accompanist.testharness)
androidTestImplementation(kotlin("test"))
debugImplementation(libs.androidx.compose.ui.testManifest)
debugImplementation(project(":ui-test-hilt-manifest"))
debugImplementation(projects.uiTestHiltManifest)

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.appcompat)
Expand All @@ -122,12 +122,13 @@ dependencies {
implementation(libs.coil.kt)

// Core functions
testImplementation(project(":core:testing"))
testImplementation(project(":core:datastore-test"))
testImplementation(project(":core:data-test"))
testImplementation(project(":core:network"))
testImplementation(projects.core.testing)
testImplementation(projects.core.datastoreTest)
testImplementation(projects.core.dataTest)
testImplementation(projects.core.network)
testImplementation(libs.androidx.navigation.testing)
testImplementation(libs.accompanist.testharness)
testImplementation(libs.work.testing)
testImplementation(kotlin("test"))
implementation(libs.work.testing)
kspTest(libs.hilt.compiler)
Expand Down
Loading

0 comments on commit e96cbcc

Please sign in to comment.