Skip to content

Commit

Permalink
Upate gradle files to reflect current app templates. (#866)
Browse files Browse the repository at this point in the history
settings.gradle:
* Add pluginManagement and dependencyResolutionManagement stanzas.

build.gradle:
* Remove declaration of repositories and dependencies, since this goes
in settings.gradle
* Use Kotlin version 1.7.10
* Use AGP version 7.3.0

app/build.gradle:
* Use `plugins { id 'foo' }` instead `apply plugin: 'foo'`
* Compile all samples with the latest version of the SDK (33) and NDK
(25.1.8937393).
* Remove kotlin-android-extensions

Furthermore:
* In CI build script, make detection of debug mode work on MacOS.
* Uncomment webp in CI build script.
* Add missing projects to CI build script (display-p3, hello-oboe,
native-midi, prefab/prefab-dependency)
* Update gradle version to 7.4
* Update hello-oboe and prefab-dependency to use view binding.
* Update native-midi to eliminate compiler warning.
  • Loading branch information
jfgoog authored Nov 28, 2022
1 parent 434180b commit 10439ab
Show file tree
Hide file tree
Showing 178 changed files with 1,176 additions and 891 deletions.
14 changes: 11 additions & 3 deletions .ci_tools/build_samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,29 @@ declare projects=(
audio-echo
bitmap-plasma
camera
display-p3
endless-tunnel
gles3jni
hello-gl2
hello-jni
hello-jniCallback
hello-libs
hello-neon
hello-oboe
native-activity
native-audio
native-codec
native-media
native-midi
native-plasma
nn-samples
prefab/curl-ssl
prefab/prefab-dependency
prefab/prefab-publishing
san-angeles
sensor-graph
# webp
teapots
webp
## ndk-build samples
other-builds/ndkbuild/bitmap-plasma
other-builds/ndkbuild/gles3jni
Expand All @@ -54,7 +58,7 @@ declare projects=(
)

VERBOSITY=--quiet
if [[ -v RUNNER_DEBUG ]] ; then
if [ -n "${RUNNER_DEBUG+1}" ] ; then
VERBOSITY=--info
fi
for d in "${projects[@]}"; do
Expand All @@ -71,22 +75,26 @@ declare apks=(
bitmap-plasma/app/build/outputs/apk/debug/app-debug.apk
camera/basic/build/outputs/apk/debug/basic-debug.apk
camera/texture-view/build/outputs/apk/debug/texture-view-debug.apk
display-p3/image-view/build/outputs/apk/debug/image-view-debug.apk
endless-tunnel/app/build/outputs/apk/debug/app-debug.apk
gles3jni/app/build/outputs/apk/debug/app-debug.apk
hello-gl2/app/build/outputs/apk/debug/app-debug.apk
hello-jni/app/build/outputs/apk/arm8/debug/app-arm8-debug.apk
hello-jniCallback/app/build/outputs/apk/debug/app-debug.apk
hello-libs/app/build/outputs/apk/debug/app-debug.apk
hello-neon/app/build/outputs/apk/debug/app-debug.apk
hello-oboe/app/build/outputs/apk/debug/app-debug.apk
native-activity/app/build/outputs/apk/debug/app-debug.apk
native-audio/app/build/outputs/apk/debug/app-debug.apk
native-codec/app/build/outputs/apk/debug/app-debug.apk
native-media/app/build/outputs/apk/debug/app-debug.apk
native-midi/app/build/outputs/apk/debug/app-debug.apk
native-plasma/app/build/outputs/apk/debug/app-debug.apk
nn-samples/basic/build/outputs/apk/debug/basic-debug.apk
nn-samples/sequence/build/outputs/apk/debug/sequence-debug.apk
prefab/curl-ssl/app/build/outputs/apk/debug/app-debug.apk
prefab/prefab-publishing/mylibrary/build/outputs/aar/mylibrary-debug.aar
prefab/prefab-dependency/app/build/outputs/apk/debug/app-debug.apk
sensor-graph/accelerometer/build/outputs/apk/debug/accelerometer-debug.apk
san-angeles/app/build/outputs/apk/debug/app-armeabi-v7a-debug.apk
san-angeles/app/build/outputs/apk/debug/app-arm64-v8a-debug.apk
Expand All @@ -95,7 +103,7 @@ declare apks=(
teapots/more-teapots/build/outputs/apk/debug/more-teapots-debug.apk
teapots/choreographer-30fps/build/outputs/apk/debug/choreographer-30fps-debug.apk
teapots/image-decoder/build/outputs/apk/debug/image-decoder-debug.apk
# webp/view/build/outputs/apk/debug/view-arm7-debug.apk
webp/view/build/outputs/apk/debug/view-debug.apk

## other-builds
other-builds/ndkbuild/bitmap-plasma/app/build/outputs/apk/debug/app-debug.apk
Expand Down
2 changes: 1 addition & 1 deletion .ci_tools/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fi
TMP_SETUP_FILENAME=versions_.txt

## Retrieve all necessary Android Platforms and install them all
retrieve_versions compileSdkVersion $TMP_SETUP_FILENAME
retrieve_versions compileSdk $TMP_SETUP_FILENAME

# Install platforms
while read -r version_; do
Expand Down
8 changes: 5 additions & 3 deletions audio-echo/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 29
ndkVersion '22.1.7171670'
compileSdk 33
ndkVersion '25.1.8937393'

defaultConfig {
applicationId 'com.google.sample.echo'
Expand Down
25 changes: 7 additions & 18 deletions audio-echo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}

allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion audio-echo/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 14 additions & 0 deletions audio-echo/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
include ':app'
8 changes: 5 additions & 3 deletions bitmap-plasma/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 29
ndkVersion '22.1.7171670'
compileSdk 33
ndkVersion '25.1.8937393'

defaultConfig.with {
applicationId 'com.example.plasma'
Expand Down
21 changes: 7 additions & 14 deletions bitmap-plasma/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
}
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}

allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion bitmap-plasma/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 14 additions & 0 deletions bitmap-plasma/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
include ':app'
2 changes: 1 addition & 1 deletion builder/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 5 additions & 3 deletions camera/basic/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 29
ndkVersion '22.1.7171670'
compileSdk 33
ndkVersion '25.1.8937393'

defaultConfig {
applicationId 'com.sample.camera.basic'
Expand Down
21 changes: 7 additions & 14 deletions camera/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
}
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}

allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion camera/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 14 additions & 0 deletions camera/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
include ':basic'
include ':texture-view'
8 changes: 5 additions & 3 deletions camera/texture-view/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 29
ndkVersion '22.1.7171670'
compileSdk 33
ndkVersion '25.1.8937393'

defaultConfig {
applicationId "com.sample.textureview"
Expand Down
21 changes: 5 additions & 16 deletions display-p3/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
}
}

allprojects {
repositories {
google()
mavenCentral()
}
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}

task clean(type: Delete) {
delete rootProject.buildDir
}
}
2 changes: 1 addition & 1 deletion display-p3/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 5 additions & 3 deletions display-p3/image-view/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 29
ndkVersion '22.1.7171670'
compileSdk 33
ndkVersion '25.1.8937393'

defaultConfig {
applicationId = 'com.example.widecolor'
Expand Down
14 changes: 14 additions & 0 deletions display-p3/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
include ':image-view'

8 changes: 5 additions & 3 deletions endless-tunnel/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
* limitations under the License.
*/

apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 29
ndkVersion '22.1.7171670'
compileSdk 33
ndkVersion '25.1.8937393'

defaultConfig {
applicationId 'com.google.sample.tunnel'
Expand Down
Loading

0 comments on commit 10439ab

Please sign in to comment.