Skip to content

Commit cce593b

Browse files
authored
Merge pull request #15 from friederbluemle/update-project
Update Gradle Wrapper and build scripts
2 parents 076effc + 6e4a94c commit cce593b

File tree

11 files changed

+115
-83
lines changed

11 files changed

+115
-83
lines changed

.gitignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
*.iml
12
.gradle
2-
/local.properties
3-
/.idea
3+
local.properties
4+
.idea/
45
.DS_Store
5-
/build
6-
*.iml
6+
build/
7+
captures/
8+
.externalNativeBuild/
9+
.cxx/

build.gradle

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,22 @@
1414
* limitations under the License.
1515
*/
1616

17-
// Top-level build file where you can add configuration options common to
18-
// all sub-projects/modules.
19-
2017
buildscript {
2118
ext {
2219
app_compat_version = '1.1.0'
2320
constraint_layout_version = '1.1.3'
24-
kotlin_version = '1.3.50'
21+
kotlin_version = '1.3.72'
2522
leanback_version = '1.1.0-alpha02'
2623
material_version = '1.1.0-alpha10'
2724
support_lib_version = '1.0.0-beta01'
2825
}
29-
3026
repositories {
3127
google()
3228
jcenter()
3329
}
3430
dependencies {
3531
classpath 'com.android.tools.build:gradle:3.6.3'
3632
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
37-
38-
// NOTE: Do not place your application dependencies here; they belong
39-
// in the individual module build.gradle files
4033
}
4134
}
4235

@@ -46,3 +39,7 @@ allprojects {
4639
jcenter()
4740
}
4841
}
42+
43+
task clean(type: Delete) {
44+
delete rootProject.buildDir
45+
}

gradle.properties

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@
2424

2525
# Specifies the JVM arguments used for the daemon process.
2626
# The setting is particularly useful for tweaking memory settings.
27-
# Default value: -Xmx10248m -XX:MaxPermSize=256m
28-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
27+
org.gradle.jvmargs=-Xmx1536m
2928

3029
# When configured, Gradle will run in incubating parallel mode.
3130
# This option should only be used with decoupled projects. More details, visit
3231
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
3332
# org.gradle.parallel=true
33+
34+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
35+
android.useAndroidX=true
36+
# Automatically convert third-party libraries to use AndroidX
3437
android.enableJetifier=true
35-
android.useAndroidX=true

gradle/wrapper/gradle-wrapper.jar

5.59 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Mon May 11 14:43:13 PDT 2020
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

gradlew

Lines changed: 61 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,59 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
2+
3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
218

319
##############################################################################
420
##
521
## Gradle start up script for UN*X
622
##
723
##############################################################################
824

9-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10-
DEFAULT_JVM_OPTS=""
25+
# Attempt to set APP_HOME
26+
# Resolve links: $0 may be a link
27+
PRG="$0"
28+
# Need this for relative symlinks.
29+
while [ -h "$PRG" ] ; do
30+
ls=`ls -ld "$PRG"`
31+
link=`expr "$ls" : '.*-> \(.*\)$'`
32+
if expr "$link" : '/.*' > /dev/null; then
33+
PRG="$link"
34+
else
35+
PRG=`dirname "$PRG"`"/$link"
36+
fi
37+
done
38+
SAVED="`pwd`"
39+
cd "`dirname \"$PRG\"`/" >/dev/null
40+
APP_HOME="`pwd -P`"
41+
cd "$SAVED" >/dev/null
1142

1243
APP_NAME="Gradle"
1344
APP_BASE_NAME=`basename "$0"`
1445

46+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48+
1549
# Use the maximum available, or set MAX_FD != -1 to use that value.
1650
MAX_FD="maximum"
1751

18-
warn ( ) {
52+
warn () {
1953
echo "$*"
2054
}
2155

22-
die ( ) {
56+
die () {
2357
echo
2458
echo "$*"
2559
echo
@@ -30,6 +64,7 @@ die ( ) {
3064
cygwin=false
3165
msys=false
3266
darwin=false
67+
nonstop=false
3368
case "`uname`" in
3469
CYGWIN* )
3570
cygwin=true
@@ -40,31 +75,11 @@ case "`uname`" in
4075
MINGW* )
4176
msys=true
4277
;;
78+
NONSTOP* )
79+
nonstop=true
80+
;;
4381
esac
4482

45-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46-
if $cygwin ; then
47-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48-
fi
49-
50-
# Attempt to set APP_HOME
51-
# Resolve links: $0 may be a link
52-
PRG="$0"
53-
# Need this for relative symlinks.
54-
while [ -h "$PRG" ] ; do
55-
ls=`ls -ld "$PRG"`
56-
link=`expr "$ls" : '.*-> \(.*\)$'`
57-
if expr "$link" : '/.*' > /dev/null; then
58-
PRG="$link"
59-
else
60-
PRG=`dirname "$PRG"`"/$link"
61-
fi
62-
done
63-
SAVED="`pwd`"
64-
cd "`dirname \"$PRG\"`/" >&-
65-
APP_HOME="`pwd -P`"
66-
cd "$SAVED" >&-
67-
6883
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6984

7085
# Determine the Java command to use to start the JVM.
@@ -90,7 +105,7 @@ location of your Java installation."
90105
fi
91106

92107
# Increase the maximum file descriptors if we can.
93-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
108+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
94109
MAX_FD_LIMIT=`ulimit -H -n`
95110
if [ $? -eq 0 ] ; then
96111
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -110,10 +125,11 @@ if $darwin; then
110125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111126
fi
112127

113-
# For Cygwin, switch paths to Windows format before running java
114-
if $cygwin ; then
128+
# For Cygwin or MSYS, switch paths to Windows format before running java
129+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
115130
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116131
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132+
JAVACMD=`cygpath --unix "$JAVACMD"`
117133

118134
# We build the pattern for arguments to be converted via cygpath
119135
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +170,19 @@ if $cygwin ; then
154170
esac
155171
fi
156172

157-
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158-
function splitJvmOpts() {
159-
JVM_OPTS=("$@")
173+
# Escape application args
174+
save () {
175+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176+
echo " "
160177
}
161-
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162-
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
178+
APP_ARGS=$(save "$@")
179+
180+
# Collect all arguments for the java command, following the shell quoting and substitution rules
181+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182+
183+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185+
cd "$(dirname "$0")"
186+
fi
163187

164-
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
188+
exec "$JAVACMD" "$@"

gradlew.bat

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -8,14 +24,14 @@
824
@rem Set local scope for the variables with windows NT shell
925
if "%OS%"=="Windows_NT" setlocal
1026

11-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12-
set DEFAULT_JVM_OPTS=
13-
1427
set DIRNAME=%~dp0
1528
if "%DIRNAME%" == "" set DIRNAME=.
1629
set APP_BASE_NAME=%~n0
1730
set APP_HOME=%DIRNAME%
1831

32+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34+
1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome
2137

@@ -46,10 +62,9 @@ echo location of your Java installation.
4662
goto fail
4763

4864
:init
49-
@rem Get command-line arguments, handling Windowz variants
65+
@rem Get command-line arguments, handling Windows variants
5066

5167
if not "%OS%" == "Windows_NT" goto win9xME_args
52-
if "%@eval[2+2]" == "4" goto 4NT_args
5368

5469
:win9xME_args
5570
@rem Slurp the command line arguments.
@@ -60,11 +75,6 @@ set _SKIP=2
6075
if "x%~1" == "x" goto execute
6176

6277
set CMD_LINE_ARGS=%*
63-
goto execute
64-
65-
:4NT_args
66-
@rem Get arguments from the 4NT Shell from JP Software
67-
set CMD_LINE_ARGS=%$
6878

6979
:execute
7080
@rem Setup the command line

mediacontroller/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

mediacontroller/build.gradle

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,40 +20,33 @@ apply plugin: 'kotlin-android-extensions'
2020

2121
android {
2222
compileSdkVersion 28
23-
24-
compileOptions {
25-
sourceCompatibility JavaVersion.VERSION_1_8
26-
targetCompatibility JavaVersion.VERSION_1_8
27-
}
28-
2923
defaultConfig {
3024
applicationId "com.example.android.mediacontroller"
3125
minSdkVersion 21
3226
targetSdkVersion 28
3327
versionCode 1
3428
versionName "1.0"
35-
3629
vectorDrawables.useSupportLibrary = true
3730
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
38-
3931
}
4032
buildTypes {
4133
release {
4234
minifyEnabled false
4335
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
4436
}
4537
}
38+
compileOptions {
39+
sourceCompatibility JavaVersion.VERSION_1_8
40+
targetCompatibility JavaVersion.VERSION_1_8
41+
}
4642
}
4743

4844
dependencies {
4945
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
50-
5146
implementation "androidx.appcompat:appcompat:$app_compat_version"
5247
implementation "androidx.constraintlayout:constraintlayout:$constraint_layout_version"
5348
implementation "androidx.cardview:cardview:$support_lib_version"
54-
implementation 'com.android.support:design:28.0.0'
55-
5649
implementation "androidx.leanback:leanback:$leanback_version"
57-
50+
implementation 'com.android.support:design:28.0.0'
5851
implementation "com.google.android.material:material:$material_version"
5952
}

mediacontroller/proguard-rules.pro

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# Add project specific ProGuard rules here.
2-
# By default, the flags in this file are appended to flags specified
3-
# in /Users/cartland/android-sdk/tools/proguard/proguard-android.txt
4-
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
64
#
75
# For more details, see
86
# http://developer.android.com/guide/developing/tools/proguard.html
97

10-
# Add any project specific keep options here:
11-
128
# If your project uses WebView with JS, uncomment the following
139
# and specify the fully qualified class name to the JavaScript interface
1410
# class:
1511
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1612
# public *;
1713
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
rootProject.name='android-media-controller'
12
include ':mediacontroller'

0 commit comments

Comments
 (0)