Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/test-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and Test a Compose snapshot

on:
workflow_dispatch:
inputs:
snapshotID:
required: true
type: string
composeVersion:
required: true
type: string

concurrency:
group: ${{ inputs.name }}-build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
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 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Generate cache key
run: ./scripts/checksum.sh ${{ inputs.path }} checksum.txt

- uses: actions/cache@v3
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}

- name: Check snapshot
working-directory: ${{ inputs.path }}
run: ./scripts/test_snapshot.sh $CI_COMPOSE_VERSION $CI_COMPOSE_SNAPSHOT
env:
CI_COMPOSE_VERSION: ${{ inputs.composeVersion }}
CI_COMPOSE_SNAPSHOT: ${{ inputs.snapshotID }}

- name: Run local tests
working-directory: ${{ inputs.path }}
run: ./gradlew testDebug --stacktrace

- name: Upload build reports
if: always()
uses: actions/upload-artifact@v3
with:
name: build-reports
path: ${{ inputs.path }}/app/build/reports
7 changes: 7 additions & 0 deletions Crane/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
val snapshotVersion : String? = System.getenv("COMPOSE_SNAPSHOT_ID")

pluginManagement {
repositories {
gradlePluginPortal()
Expand All @@ -23,6 +25,11 @@ pluginManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
snapshotVersion?.let {
println("https://androidx.dev/snapshots/builds/$it/artifacts/repository/")
maven { url = uri("https://androidx.dev/snapshots/builds/$it/artifacts/repository/") }
}

google()
mavenCentral()
}
Expand Down
22 changes: 22 additions & 0 deletions JetNews/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
val snapshotVersion : String? = System.getenv("COMPOSE_SNAPSHOT_ID")

pluginManagement {
repositories {
gradlePluginPortal()
Expand All @@ -8,6 +25,11 @@ pluginManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
snapshotVersion?.let {
println("https://androidx.dev/snapshots/builds/$it/artifacts/repository/")
maven { url = uri("https://androidx.dev/snapshots/builds/$it/artifacts/repository/") }
}

google()
mavenCentral()
}
Expand Down
7 changes: 7 additions & 0 deletions Jetcaster/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
val snapshotVersion : String? = System.getenv("COMPOSE_SNAPSHOT_ID")

pluginManagement {
repositories {
gradlePluginPortal()
Expand All @@ -23,6 +25,11 @@ pluginManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
snapshotVersion?.let {
println("https://androidx.dev/snapshots/builds/$it/artifacts/repository/")
maven { url = uri("https://androidx.dev/snapshots/builds/$it/artifacts/repository/") }
}

google()
mavenCentral()
}
Expand Down
7 changes: 7 additions & 0 deletions Jetchat/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
val snapshotVersion : String? = System.getenv("COMPOSE_SNAPSHOT_ID")

pluginManagement {
repositories {
gradlePluginPortal()
Expand All @@ -23,6 +25,11 @@ pluginManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
snapshotVersion?.let {
println("https://androidx.dev/snapshots/builds/$it/artifacts/repository/")
maven { url = uri("https://androidx.dev/snapshots/builds/$it/artifacts/repository/") }
}

google()
mavenCentral()
}
Expand Down
22 changes: 22 additions & 0 deletions Jetsnack/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
val snapshotVersion : String? = System.getenv("COMPOSE_SNAPSHOT_ID")

pluginManagement {
repositories {
gradlePluginPortal()
Expand All @@ -8,6 +25,11 @@ pluginManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
snapshotVersion?.let {
println("https://androidx.dev/snapshots/builds/$it/artifacts/repository/")
maven { url = uri("https://androidx.dev/snapshots/builds/$it/artifacts/repository/") }
}

google()
mavenCentral()
}
Expand Down
16 changes: 0 additions & 16 deletions Jetsurvey/settings.gradle

This file was deleted.

38 changes: 38 additions & 0 deletions Jetsurvey/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
val snapshotVersion : String? = System.getenv("COMPOSE_SNAPSHOT_ID")

pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
snapshotVersion?.let {
println("https://androidx.dev/snapshots/builds/$it/artifacts/repository/")
maven { url = uri("https://androidx.dev/snapshots/builds/$it/artifacts/repository/") }
}

google()
mavenCentral()
}
}
include(":app")
rootProject.name = "Jetsurvey"
15 changes: 0 additions & 15 deletions Owl/settings.gradle

This file was deleted.

38 changes: 38 additions & 0 deletions Owl/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
val snapshotVersion : String? = System.getenv("COMPOSE_SNAPSHOT_ID")

pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
snapshotVersion?.let {
println("https://androidx.dev/snapshots/builds/$it/artifacts/repository/")
maven { url = uri("https://androidx.dev/snapshots/builds/$it/artifacts/repository/") }
}

google()
mavenCentral()
}
}
rootProject.name = "Owl"
include(":app")
8 changes: 7 additions & 1 deletion Reply/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
val snapshotVersion : String? = System.getenv("COMPOSE_SNAPSHOT_ID")

pluginManagement {
repositories {
Expand All @@ -24,6 +25,11 @@ pluginManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
snapshotVersion?.let {
println("https://androidx.dev/snapshots/builds/$it/artifacts/repository/")
maven { url = uri("https://androidx.dev/snapshots/builds/$it/artifacts/repository/") }
}

google()
mavenCentral()
}
Expand Down
50 changes: 50 additions & 0 deletions scripts/test_snapshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# Copyright (C) 2022 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

########################################################################
#
# Allows testing a snapshot version across all samples
#
# Example: To run build over all projects run:
# ./scripts/test_snapshot.sh
#
########################################################################

if [ -z "$1" ]; then
read -p "Enter compose version e.g. 1.3.0: " compose_ver
else
echo "Using compose version: $1"
compose_ver=$1
fi
if [ -z "$2" ]; then
read -p "Enter snapshot ID: " snapshot
else
echo "Using compose snapshot: $2"
snapshot=$2
fi
export COMPOSE_SNAPSHOT_ID=$snapshot

# Switch version to SNAPSHOT
cp ./scripts/libs.versions.toml ./scripts/libs.versions.toml.tmp
sed -i '' -e 's/^compose = ".*"/compose = "'$compose_ver'-SNAPSHOT"/g' ./scripts/libs.versions.toml

# Copy to all samples and verify
./scripts/duplicate_version_config.sh
./scripts/verify_samples.sh

# Undo all changes
mv ./scripts/libs.versions.toml.tmp ./scripts/libs.versions.toml
./scripts/duplicate_version_config.sh