Skip to content

Commit 6129aa8

Browse files
authored
Merge branch 'androidx' into master
2 parents 86226ef + 29d5fe2 commit 6129aa8

File tree

11 files changed

+99
-54
lines changed

11 files changed

+99
-54
lines changed

build.gradle

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ apply plugin: 'java'
99
buildscript {
1010
repositories {
1111
google()
12-
jcenter()
12+
jcenter()
1313
}
1414
dependencies {
1515
classpath 'com.android.tools.build:gradle:3.5.1'
@@ -82,13 +82,19 @@ allprojects {
8282
repositories {
8383
google()
8484
jcenter()
85-
maven {
86-
// mavenCentral() does not work to download the Gradle releases of gradle-tooling-api, one needs
87-
// to set the artifact url as below to get the latest packages.
88-
// https://mvnrepository.com/artifact/org.gradle/gradle-tooling-api?repo=gradle-libs-releases-local
89-
url "https://repo1.maven.org/maven2"
90-
artifactUrls "https://repo.gradle.org/gradle/libs-releases-local"
91-
}
85+
86+
maven { url "https://maven.google.com" }
87+
maven { url "https://jitpack.io" }
88+
89+
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
90+
91+
// maven {
92+
// // mavenCentral() does not work to download the Gradle releases of gradle-tooling-api, one needs
93+
// // to set the artifact url as below to get the latest packages.
94+
// // https://mvnrepository.com/artifact/org.gradle/gradle-tooling-api?repo=gradle-libs-releases-local
95+
// url "https://repo1.maven.org/maven2"
96+
// artifactUrls "https://repo.gradle.org/gradle/libs-releases-local"
97+
// }
9298
flatDir dirs: androidPlatformPath
9399
flatDir dirs: androidToolsLibPath
94100
flatDir dirs: "${rootDir}/core/dist"

core/build.gradle

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,15 @@ clean.doFirst {
8080
}
8181

8282
compileJava.doFirst {
83-
String[] deps = ["percent.jar",
84-
"recyclerview-v7.jar",
85-
"support-compat.jar",
86-
"support-core-ui.jar",
87-
"support-core-utils.jar",
88-
"support-fragment.jar",
89-
"support-media-compat.jar",
90-
"support-v4.jar",
83+
String[] deps = [
84+
// "percent.jar",
85+
// "recyclerview-v7.jar",
86+
// "support-compat.jar",
87+
// "support-core-ui.jar",
88+
// "support-core-utils.jar",
89+
// "support-fragment.jar",
90+
// "support-media-compat.jar",
91+
// "support-v4.jar",
9192
"wearable.jar"]
9293
for (String fn : deps) {
9394
Files.copy(file("${rootDir}/build/libs/" + fn).toPath(),

gradle/wrapper/gradle-wrapper.jar

1.25 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip

gradlew

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

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+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"
@@ -109,8 +125,8 @@ if $darwin; then
109125
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110126
fi
111127

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

gradlew.bat

Lines changed: 17 additions & 1 deletion
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
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

1632
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1834

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome

mode/src/processing/mode/android/AndroidBuild.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ class AndroidBuild extends JavaBuild {
8686
static private final String XML_WATCHFACE_TEMPLATE = "XMLWatchFace.xml.tmpl";
8787

8888
// Gradle build files
89-
static private final String GRADLE_SETTINGS_TEMPLATE = "Settings.gradle.tmpl";
89+
static private final String GRADLE_SETTINGS_TEMPLATE = "Settings.gradle.tmpl";
90+
static private final String GRADLE_PROPERTIES_TEMPLATE = "Properties.gradle.tmpl";
91+
static private final String LOCAL_PROPERTIES_TEMPLATE = "Properties.local.tmpl";
9092
static private final String TOP_GRADLE_BUILD_TEMPLATE = "TopBuild.gradle.tmpl";
9193
static private final String APP_GRADLE_BUILD_ECJ_TEMPLATE = "AppBuildECJ.gradle.tmpl";
9294
static private final String APP_GRADLE_BUILD_TEMPLATE = "AppBuild.gradle.tmpl";
@@ -288,16 +290,30 @@ private void createTopModule(String projectModules)
288290
File buildTemplate = mode.getContentFile("templates/" + TOP_GRADLE_BUILD_TEMPLATE);
289291
File buildlFile = new File(tmpFolder, "build.gradle");
290292
Util.copyFile(buildTemplate, buildlFile);
293+
294+
File gradlePropsTemplate = mode.getContentFile("templates/" + GRADLE_PROPERTIES_TEMPLATE);
295+
File gradlePropsFile = new File(tmpFolder, "gradle.properties");
296+
Util.copyFile(gradlePropsTemplate, gradlePropsFile);
291297

292-
writeLocalProps(new File(tmpFolder, "local.properties"));
293-
AndroidUtil.writeFile(new File(tmpFolder, "gradle.properties"),
294-
new String[]{"org.gradle.jvmargs=-Xmx1536m"});
295-
296-
File settingsTemplate = mode.getContentFile("templates/" + GRADLE_SETTINGS_TEMPLATE);
298+
File settingsTemplate = mode.getContentFile("templates/" + GRADLE_SETTINGS_TEMPLATE);
297299
File settingsFile = new File(tmpFolder, "settings.gradle");
298300
HashMap<String, String> replaceMap = new HashMap<String, String>();
299-
replaceMap.put("@@project_modules@@", projectModules);
300-
AndroidUtil.createFileFromTemplate(settingsTemplate, settingsFile, replaceMap);
301+
replaceMap.put("@@project_modules@@", projectModules);
302+
AndroidUtil.createFileFromTemplate(settingsTemplate, settingsFile, replaceMap);
303+
304+
File localPropsTemplate = mode.getContentFile("templates/" + LOCAL_PROPERTIES_TEMPLATE);
305+
File localPropsFile = new File(tmpFolder, "local.properties");
306+
replaceMap.clear();
307+
final String sdkPath = sdk.getFolder().getAbsolutePath();
308+
if (Platform.isWindows()) {
309+
// Windows needs backslashes escaped, or it will also accept forward
310+
// slashes in the build file. We're using the forward slashes since this
311+
// path gets concatenated with a lot of others that use forwards anyway.
312+
replaceMap.put("@@sdk_path@@", sdkPath.replace('\\', '/'));
313+
} else {
314+
replaceMap.put("@@sdk_path@@", sdkPath);
315+
}
316+
AndroidUtil.createFileFromTemplate(localPropsTemplate, localPropsFile, replaceMap);
301317
}
302318

303319

@@ -551,22 +567,6 @@ private void writeResXMLWatchFace(final File xmlFolder) {
551567
}
552568

553569

554-
private void writeLocalProps(final File file) {
555-
final PrintWriter writer = PApplet.createWriter(file);
556-
final String sdkPath = sdk.getFolder().getAbsolutePath();
557-
if (Platform.isWindows()) {
558-
// Windows needs backslashes escaped, or it will also accept forward
559-
// slashes in the build file. We're using the forward slashes since this
560-
// path gets concatenated with a lot of others that use forwards anyway.
561-
writer.println("sdk.dir=" + sdkPath.replace('\\', '/'));
562-
} else {
563-
writer.println("sdk.dir=" + sdkPath);
564-
}
565-
writer.flush();
566-
writer.close();
567-
}
568-
569-
570570
private void writeRes(File resFolder) throws SketchException {
571571
File layoutFolder = AndroidUtil.createPath(resFolder, "layout");
572572
writeResLayoutMainActivity(layoutFolder);

mode/templates/Properties.gradle.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
org.gradle.jvmargs=-Xmx1536m
2+
android.enableJetifier=true
3+
android.useAndroidX=true

mode/templates/Properties.local.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sdk.dir=@@sdk_path@@

mode/templates/TopBuild.gradle.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.0.1'
10+
classpath 'com.android.tools.build:gradle:4.1.1'
1111

1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files
@@ -16,6 +16,8 @@ buildscript {
1616

1717
allprojects {
1818
repositories {
19+
maven { url "https://maven.google.com" }
20+
maven { url "https://jitpack.io" }
1921
google()
2022
jcenter()
2123
}

mode/version.properties

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Basics
22
android-platform = 28
33
android-toolslib = 26.0.0-dev
4-
gradlew = 5.6.2
4+
gradlew = 6.7.1
55

66
# Minimum SDK versions for each type of project
77
android-min-app = 17
@@ -12,13 +12,13 @@ android-min-wear = 25
1212

1313
# Dependencies. Latest version for each package can be found at https://mvnrepository.com
1414
# The format below is group%artifact
15+
androidx.appcompat%appcompat = 1.2.0
1516
com.android.support%support-v4 = 28.0.0
16-
com.google.android.support%wearable = 2.4.0
17-
com.google.android.gms%play-services-wearable = 16.0.1
17+
com.google.android.support%wearable = 2.8.1
18+
com.google.android.gms%play-services-wearable = 17.0.0
1819
com.google.vr = 1.180.0
19-
com.google.ar = 1.12.0
20+
com.google.ar = 1.22.0
2021
org.processing = 3.3.7
21-
org.gradle%gradle-tooling-api = 5.6.2
22-
org.slf4j = 1.7.28
23-
org.eclipse.jdt = 3.11.100
24-
androidx.appcompat%appcompat = 1.2.0
22+
org.gradle%gradle-tooling-api = 6.7.1
23+
org.slf4j = 1.7.30
24+
org.eclipse.jdt = 3.11.100

0 commit comments

Comments
 (0)