diff --git a/.gitignore b/.gitignore index 5310da0af..c5e064fae 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,8 @@ mode/mode/wearable.jar mode/libraries/vr/library mode/libraries/ar/library -mode/tools/SDKUpdated/tool +mode/tools/SDKUpdater/tool +mode/tools/SDKUpdater/lib debug/.gradle debug/.idea diff --git a/build.gradle b/build.gradle index 805bdfa17..969b60e65 100644 --- a/build.gradle +++ b/build.gradle @@ -9,12 +9,12 @@ apply plugin: 'java' buildscript { repositories { google() - jcenter() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.1' - classpath group: 'commons-io', name: 'commons-io', version: '2.6' - classpath group: 'org.zeroturnaround', name: 'zt-zip', version: '1.13' + classpath 'com.android.tools.build:gradle:4.1.1' + classpath group: 'commons-io', name: 'commons-io', version: '2.8.0' + classpath group: 'org.zeroturnaround', name: 'zt-zip', version: '1.14' } } @@ -25,7 +25,8 @@ allprojects { Properties versions = new Properties() versions.load(project.rootProject.file("mode/version.properties").newDataInputStream()) ext.targetSdkVersion = versions.getProperty("android-platform") - ext.supportLibsVersion = versions.getProperty("com.android.support%support-v4") + ext.appcompatVersion = versions.getProperty("androidx.appcompat%appcompat") + ext.v4legacyVersion = versions.getProperty("androidx.legacy%legacy-support-v4") ext.wearVersion = versions.getProperty("com.google.android.support%wearable") ext.gvrVersion = versions.getProperty("com.google.vr") ext.garVersion = versions.getProperty("com.google.ar") @@ -72,27 +73,26 @@ allprojects { localProperties.load(project.rootProject.file("local.properties").newDataInputStream()) def sdkDir = localProperties.getProperty("sdk.dir") ext.androidPlatformPath = "${sdkDir}/platforms/android-${targetSdkVersion}" - ext.androidToolsLibPath = "${sdkDir}/tools/lib" - ext.coreZipPath = "${rootDir}/mode/processing-core.zip" repositories { google() jcenter() - maven { - // mavenCentral() does not work to download the Gradle releases of gradle-tooling-api, one needs - // to set the artifact url as below to get the latest packages. - // https://mvnrepository.com/artifact/org.gradle/gradle-tooling-api?repo=gradle-libs-releases-local - url "https://repo1.maven.org/maven2" - artifactUrls "https://repo.gradle.org/gradle/libs-releases-local" - } + maven { url "https://maven.google.com" } + maven { url "https://jitpack.io" } + maven { url 'https://repo.gradle.org/gradle/libs-releases' } flatDir dirs: androidPlatformPath - flatDir dirs: androidToolsLibPath flatDir dirs: "${rootDir}/core/dist" } - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + compileJava { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + // Uncomment this option when building with Java 11+ + // https://github.com/processing/processing-android/issues/625 + // options.release = 8 + } } clean.doFirst { @@ -128,9 +128,11 @@ task dist { FileUtils.copyDirectory(file("mode/languages"), file("${root}/languages")) - FileUtils.copyDirectory(file("mode/tools/SDKUpdater/tool"), + FileUtils.copyDirectory(file("mode/tools/SDKUpdater/tool"), file("${root}/tools/SDKUpdater/tool")) - FileUtils.copyDirectory(file("mode/tools/SDKUpdater/src"), + FileUtils.copyDirectory(file("mode/tools/SDKUpdater/lib"), + file("${root}/tools/SDKUpdater/lib")) + FileUtils.copyDirectory(file("mode/tools/SDKUpdater/src"), file("${root}/tools/SDKUpdater/src")) FileUtils.copyDirectory(file("mode/libraries/vr/examples"), diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index effe4713d..8c91d6e0b 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -8,5 +8,5 @@ repositories { dependencies { implementation gradleApi() implementation localGroovy() - implementation 'com.android.tools.build:gradle:3.5.1' + implementation 'com.android.tools.build:gradle:4.1.1' } \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle index 002621c9a..3bbae4b10 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,13 +1,13 @@ import java.nio.file.Files import static java.nio.file.StandardCopyOption.REPLACE_EXISTING -apply plugin: 'maven' apply plugin: 'aar' +apply plugin: 'maven' dependencies { implementation name: "android" - implementationAar "com.android.support:support-v4:${supportLibsVersion}" + implementationAar "androidx.legacy:legacy-support-v4:${v4legacyVersion}" implementationAar "com.google.android.support:wearable:${wearVersion}" } @@ -27,9 +27,9 @@ task createPom { } dependencies { dependency { - groupId "com.android.support" - artifactId "support-v4" - version "${supportLibsVersion}" + groupId "androidx.legacy" + artifactId "legacy-support-v4" + version "${v4legacyVersion}" scope "implementation" } dependency { @@ -80,15 +80,7 @@ clean.doFirst { } compileJava.doFirst { - String[] deps = ["percent.jar", - "recyclerview-v7.jar", - "support-compat.jar", - "support-core-ui.jar", - "support-core-utils.jar", - "support-fragment.jar", - "support-media-compat.jar", - "support-v4.jar", - "wearable.jar"] + String[] deps = ["wearable.jar"] for (String fn : deps) { Files.copy(file("${rootDir}/build/libs/" + fn).toPath(), file("${rootDir}/mode/mode/" + fn).toPath(), REPLACE_EXISTING) diff --git a/core/src/processing/a2d/PGraphicsAndroid2D.java b/core/src/processing/a2d/PGraphicsAndroid2D.java index 53df26eb2..ed52de298 100644 --- a/core/src/processing/a2d/PGraphicsAndroid2D.java +++ b/core/src/processing/a2d/PGraphicsAndroid2D.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2005-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or @@ -23,6 +23,19 @@ package processing.a2d; +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.ActivityManager; +import android.app.ActivityManager.MemoryInfo; +import android.content.Context; +import android.graphics.*; +import android.graphics.Bitmap.Config; +import android.graphics.Paint.Style; +import android.os.Build; +import android.os.Environment; +import android.view.SurfaceHolder; +import static android.os.Environment.isExternalStorageRemovable; + import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -45,21 +58,6 @@ import processing.core.PSurface; import processing.data.XML; -import android.annotation.SuppressLint; -import android.app.Activity; -import android.app.ActivityManager; -import android.app.ActivityManager.MemoryInfo; -import android.content.Context; -import android.graphics.*; -import android.graphics.Bitmap.Config; -import android.graphics.Paint.Style; -import android.os.Build; -import android.os.Environment; -import android.view.SurfaceHolder; - -import static android.os.Environment.isExternalStorageRemovable; - - /** * Subclass for PGraphics that implements the graphics API using * the Android 2D graphics model. Similar tradeoffs to JAVA2D mode diff --git a/core/src/processing/a2d/PShapeAndroid2D.java b/core/src/processing/a2d/PShapeAndroid2D.java index e5ace2266..b9bb2c019 100644 --- a/core/src/processing/a2d/PShapeAndroid2D.java +++ b/core/src/processing/a2d/PShapeAndroid2D.java @@ -1,6 +1,29 @@ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + Part of the Processing project - http://processing.org + + Copyright (c) 2016-21 The Processing Foundation + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License version 2.1 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA +*/ + package processing.a2d; import android.graphics.Shader; + import processing.core.PGraphics; import processing.core.PShapeSVG; import processing.data.XML; diff --git a/core/src/processing/a2d/PSurfaceAndroid2D.java b/core/src/processing/a2d/PSurfaceAndroid2D.java index 47297ea25..eb7635b87 100644 --- a/core/src/processing/a2d/PSurfaceAndroid2D.java +++ b/core/src/processing/a2d/PSurfaceAndroid2D.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -23,7 +23,6 @@ package processing.a2d; import android.content.Context; - import android.graphics.Color; import android.graphics.PixelFormat; import android.service.wallpaper.WallpaperService; @@ -31,6 +30,7 @@ import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; + import processing.android.AppComponent; import processing.android.PFragment; import processing.core.PApplet; diff --git a/core/src/processing/android/ActivityAPI.java b/core/src/processing/android/ActivityAPI.java index e668ea63d..751ec2048 100644 --- a/core/src/processing/android/ActivityAPI.java +++ b/core/src/processing/android/ActivityAPI.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016-17 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/core/src/processing/android/AppComponent.java b/core/src/processing/android/AppComponent.java index 1574061ee..396e01126 100644 --- a/core/src/processing/android/AppComponent.java +++ b/core/src/processing/android/AppComponent.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016-17 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -23,6 +23,7 @@ package processing.android; import android.content.Intent; + import processing.core.PApplet; import processing.core.PConstants; diff --git a/core/src/processing/android/CompatUtils.java b/core/src/processing/android/CompatUtils.java index b4f8f55bd..e218e860b 100644 --- a/core/src/processing/android/CompatUtils.java +++ b/core/src/processing/android/CompatUtils.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2017 The Processing Foundation + Copyright (c) 2017-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -22,9 +22,6 @@ package processing.android; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.atomic.AtomicInteger; import android.annotation.SuppressLint; import android.os.Build; import android.util.DisplayMetrics; @@ -32,6 +29,10 @@ import android.view.View; import android.graphics.Point; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.atomic.AtomicInteger; + /** * Compatibility utilities that work across versions of Android. Even though * the mode sets API level 17 (Android 4.2) as the minimum target, because the diff --git a/core/src/processing/android/PFragment.java b/core/src/processing/android/PFragment.java index 1a2132ed3..a6be21fbf 100644 --- a/core/src/processing/android/PFragment.java +++ b/core/src/processing/android/PFragment.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016-17 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -22,12 +22,6 @@ package processing.android; -import android.support.annotation.IdRes; -import android.support.annotation.LayoutRes; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; import android.util.DisplayMetrics; import android.content.Intent; import android.content.pm.ActivityInfo; @@ -44,6 +38,14 @@ import android.view.ViewGroup; import android.view.WindowManager; import android.view.ContextMenu.ContextMenuInfo; + +import androidx.annotation.IdRes; +import androidx.annotation.LayoutRes; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; + import processing.core.PApplet; public class PFragment extends Fragment implements AppComponent { diff --git a/core/src/processing/android/PWallpaper.java b/core/src/processing/android/PWallpaper.java index a285fc90d..850339100 100644 --- a/core/src/processing/android/PWallpaper.java +++ b/core/src/processing/android/PWallpaper.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016-17 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,12 +26,12 @@ import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.WindowManager; -import processing.core.PApplet; import android.util.DisplayMetrics; import android.view.Display; import android.graphics.Point; import android.graphics.Rect; +import processing.core.PApplet; public class PWallpaper extends WallpaperService implements AppComponent { private Point size; diff --git a/core/src/processing/android/PWatchFaceCanvas.java b/core/src/processing/android/PWatchFaceCanvas.java index 227022cfe..ee4222dfc 100644 --- a/core/src/processing/android/PWatchFaceCanvas.java +++ b/core/src/processing/android/PWatchFaceCanvas.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016-17 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -38,6 +38,7 @@ import android.view.SurfaceHolder; import android.view.WindowInsets; import android.view.WindowManager; + import processing.a2d.PGraphicsAndroid2D; import processing.core.PApplet; diff --git a/core/src/processing/android/PWatchFaceGLES.java b/core/src/processing/android/PWatchFaceGLES.java index 8d385d286..0fae68c50 100644 --- a/core/src/processing/android/PWatchFaceGLES.java +++ b/core/src/processing/android/PWatchFaceGLES.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016-17 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -37,10 +37,11 @@ import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.WindowManager; -import processing.core.PApplet; +import android.graphics.Rect; + import java.lang.reflect.Method; -import android.graphics.Rect; +import processing.core.PApplet; @TargetApi(21) public class PWatchFaceGLES extends Gles2WatchFaceService implements AppComponent { diff --git a/core/src/processing/android/PermissionRequestor.java b/core/src/processing/android/PermissionRequestor.java index 93c939238..0754badc3 100644 --- a/core/src/processing/android/PermissionRequestor.java +++ b/core/src/processing/android/PermissionRequestor.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2017 The Processing Foundation + Copyright (c) 2017-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -24,8 +24,9 @@ import android.app.Activity; import android.os.Bundle; -import android.support.v4.app.ActivityCompat; + import android.support.v4.os.ResultReceiver; +import androidx.core.app.ActivityCompat; // A simple utility activity to request permissions in a service. public class PermissionRequestor extends Activity { diff --git a/core/src/processing/android/ServiceEngine.java b/core/src/processing/android/ServiceEngine.java index 4ca043075..11b1164f0 100644 --- a/core/src/processing/android/ServiceEngine.java +++ b/core/src/processing/android/ServiceEngine.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2017 The Processing Foundation + Copyright (c) 2017-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -23,6 +23,7 @@ package processing.android; import android.graphics.Rect; + import processing.core.PConstants; public interface ServiceEngine extends PConstants { diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 24e5dd3a7..53592da97 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-17 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology @@ -24,29 +24,23 @@ package processing.core; -import java.io.*; -import java.lang.reflect.*; -import java.net.*; -import java.text.NumberFormat; -import java.util.*; -import java.util.regex.*; -import java.util.zip.*; - -import android.app.FragmentManager; -import android.view.Window; -import android.view.inputmethod.InputMethodManager; import android.app.Activity; -import android.content.*; +import android.app.FragmentManager; +import android.content.Context; +import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.AssetManager; -import android.graphics.*; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Rect; +import android.graphics.Typeface; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Looper; -import android.support.annotation.LayoutRes; import android.view.ContextMenu; +import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -55,14 +49,63 @@ import android.view.SurfaceHolder; import android.view.View; import android.view.ViewGroup; -import android.view.ContextMenu.ContextMenuInfo; +import android.view.Window; +import android.view.inputmethod.InputMethodManager; + +import androidx.annotation.LayoutRes; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.StringReader; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.*; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Random; +import java.util.StringTokenizer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + import processing.a2d.PGraphicsAndroid2D; import processing.android.ActivityAPI; import processing.android.AppComponent; import processing.android.CompatUtils; -import processing.data.*; -import processing.event.*; -import processing.opengl.*; +import processing.data.JSONArray; +import processing.data.JSONObject; +import processing.data.StringList; +import processing.data.Table; +import processing.data.XML; +import processing.event.Event; +import processing.event.KeyEvent; +import processing.event.MouseEvent; +import processing.event.TouchEvent; +import processing.opengl.PGL; +import processing.opengl.PGraphics2D; +import processing.opengl.PGraphics3D; +import processing.opengl.PShader; public class PApplet extends Object implements ActivityAPI, PConstants { diff --git a/core/src/processing/core/PConstants.java b/core/src/processing/core/PConstants.java index a8be77fd0..14753a133 100644 --- a/core/src/processing/core/PConstants.java +++ b/core/src/processing/core/PConstants.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/core/PFont.java b/core/src/processing/core/PFont.java index 6d30c539c..48a01b3cc 100644 --- a/core/src/processing/core/PFont.java +++ b/core/src/processing/core/PFont.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index e4ebe402d..eac4f46c4 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/core/PImage.java b/core/src/processing/core/PImage.java index 221e42bfa..8eceaf2c4 100644 --- a/core/src/processing/core/PImage.java +++ b/core/src/processing/core/PImage.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/core/PMatrix.java b/core/src/processing/core/PMatrix.java index 52e14a823..1c6fabc3f 100644 --- a/core/src/processing/core/PMatrix.java +++ b/core/src/processing/core/PMatrix.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2005-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or diff --git a/core/src/processing/core/PMatrix2D.java b/core/src/processing/core/PMatrix2D.java index 31226e78a..8d13979b7 100644 --- a/core/src/processing/core/PMatrix2D.java +++ b/core/src/processing/core/PMatrix2D.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2005-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or diff --git a/core/src/processing/core/PMatrix3D.java b/core/src/processing/core/PMatrix3D.java index fbd662821..9167af1f0 100644 --- a/core/src/processing/core/PMatrix3D.java +++ b/core/src/processing/core/PMatrix3D.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2005-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index 4703aab4b..a609a9e4e 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-19 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2006-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or @@ -29,8 +29,6 @@ import java.util.HashMap; import java.util.Map; -import processing.core.PApplet; - /** * ( begin auto-generated from PShape.xml ) diff --git a/core/src/processing/core/PShapeOBJ.java b/core/src/processing/core/PShapeOBJ.java index 935634741..96e0bc8de 100644 --- a/core/src/processing/core/PShapeOBJ.java +++ b/core/src/processing/core/PShapeOBJ.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Hashtable; + /** * This class is not part of the Processing API and should not be used * directly. Instead, use loadShape() and methods like it, which will make diff --git a/core/src/processing/core/PShapeSVG.java b/core/src/processing/core/PShapeSVG.java index ce83a6951..33bd932b8 100644 --- a/core/src/processing/core/PShapeSVG.java +++ b/core/src/processing/core/PShapeSVG.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-19 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2006-12 Ben Fry and Casey Reas Copyright (c) 2004-06 Michael Chang diff --git a/core/src/processing/core/PStyle.java b/core/src/processing/core/PStyle.java index e52ddc3f2..f5e1ecffb 100644 --- a/core/src/processing/core/PStyle.java +++ b/core/src/processing/core/PStyle.java @@ -3,7 +3,9 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2008-10 Ben Fry and Casey Reas + Copyright (c) 2012-21 The Processing Foundation + Copyright (c) 2006-12 Ben Fry and Casey Reas + Copyright (c) 2004-06 Michael Chang This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/core/src/processing/core/PSurface.java b/core/src/processing/core/PSurface.java index 4cc0dc74f..4a2ec763b 100644 --- a/core/src/processing/core/PSurface.java +++ b/core/src/processing/core/PSurface.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -22,9 +22,6 @@ package processing.core; -import java.io.File; -import java.io.InputStream; - import android.app.Activity; import android.content.Context; import android.content.Intent; @@ -36,6 +33,10 @@ import android.view.SurfaceView; import android.view.View; import android.view.ViewGroup; + +import java.io.File; +import java.io.InputStream; + import processing.android.AppComponent; import processing.android.ServiceEngine; diff --git a/core/src/processing/core/PSurfaceNone.java b/core/src/processing/core/PSurfaceNone.java index cd350b873..46cb92050 100644 --- a/core/src/processing/core/PSurfaceNone.java +++ b/core/src/processing/core/PSurfaceNone.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -33,8 +33,6 @@ import android.os.Handler; import android.os.Looper; import android.service.wallpaper.WallpaperService; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; import android.support.wearable.watchface.WatchFaceService; import android.view.LayoutInflater; import android.view.SurfaceHolder; @@ -46,6 +44,9 @@ import android.widget.RelativeLayout; import android.support.v4.os.ResultReceiver; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; @@ -89,14 +90,15 @@ public AppComponent getComponent() { @Override public Context getContext() { - if (component.getKind() == AppComponent.FRAGMENT) { + return activity; + /*if (component.getKind() == AppComponent.FRAGMENT) { return activity; } else if (component.getKind() == AppComponent.WALLPAPER) { return wallpaper; } else if (component.getKind() == AppComponent.WATCHFACE) { return watchface; } - return null; + */ } diff --git a/core/src/processing/core/PVector.java b/core/src/processing/core/PVector.java index 7e652127c..d1c074f92 100644 --- a/core/src/processing/core/PVector.java +++ b/core/src/processing/core/PVector.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2008-12 Ben Fry and Casey Reas Copyright (c) 2008 Dan Shiffman diff --git a/core/src/processing/data/Table.java b/core/src/processing/data/Table.java index 4d18651cc..2048376cf 100644 --- a/core/src/processing/data/Table.java +++ b/core/src/processing/data/Table.java @@ -3,7 +3,8 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2011-13 Ben Fry and Casey Reas + Copyright (c) 2012-21 The Processing Foundation + Copyright (c) 2011-12 Ben Fry and Casey Reas Copyright (c) 2006-11 Ben Fry This library is free software; you can redistribute it and/or diff --git a/core/src/processing/data/XML.java b/core/src/processing/data/XML.java index 49880c888..f2c2e32cc 100644 --- a/core/src/processing/data/XML.java +++ b/core/src/processing/data/XML.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2009-12 Ben Fry and Casey Reas This library is free software; you can redistribute it and/or diff --git a/core/src/processing/event/Event.java b/core/src/processing/event/Event.java index aa5b8544f..109dbbee7 100644 --- a/core/src/processing/event/Event.java +++ b/core/src/processing/event/Event.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/core/src/processing/event/KeyEvent.java b/core/src/processing/event/KeyEvent.java index 0778db483..4a9bdf44d 100644 --- a/core/src/processing/event/KeyEvent.java +++ b/core/src/processing/event/KeyEvent.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/core/src/processing/event/MouseEvent.java b/core/src/processing/event/MouseEvent.java index c6c6c5e48..012f4e29e 100644 --- a/core/src/processing/event/MouseEvent.java +++ b/core/src/processing/event/MouseEvent.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/core/src/processing/event/TouchEvent.java b/core/src/processing/event/TouchEvent.java index 2add7c140..440a7824e 100644 --- a/core/src/processing/event/TouchEvent.java +++ b/core/src/processing/event/TouchEvent.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/core/src/processing/opengl/FontTexture.java b/core/src/processing/opengl/FontTexture.java index 52ec62f2a..cc67259bb 100644 --- a/core/src/processing/opengl/FontTexture.java +++ b/core/src/processing/opengl/FontTexture.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/opengl/FrameBuffer.java b/core/src/processing/opengl/FrameBuffer.java index 239054784..a5426c52d 100644 --- a/core/src/processing/opengl/FrameBuffer.java +++ b/core/src/processing/opengl/FrameBuffer.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 01b5f305e..18e4d8bb8 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-17 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/opengl/PGLES.java b/core/src/processing/opengl/PGLES.java index 1146ac6c2..e31799170 100644 --- a/core/src/processing/opengl/PGLES.java +++ b/core/src/processing/opengl/PGLES.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology @@ -37,6 +37,7 @@ import android.opengl.GLSurfaceView; import android.opengl.GLU; import android.view.SurfaceView; + import processing.opengl.tess.PGLU; import processing.opengl.tess.PGLUtessellator; import processing.opengl.tess.PGLUtessellatorCallbackAdapter; diff --git a/core/src/processing/opengl/PGraphics2D.java b/core/src/processing/opengl/PGraphics2D.java index 9422d08d4..2fdd47543 100644 --- a/core/src/processing/opengl/PGraphics2D.java +++ b/core/src/processing/opengl/PGraphics2D.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/opengl/PGraphics2DX.java b/core/src/processing/opengl/PGraphics2DX.java index e5ff1480c..60fee8e16 100755 --- a/core/src/processing/opengl/PGraphics2DX.java +++ b/core/src/processing/opengl/PGraphics2DX.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2019 The Processing Foundation + Copyright (c) 2019-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -30,7 +30,6 @@ import processing.core.PApplet; import processing.core.PGraphics; import processing.core.PImage; -import processing.core.PMatrix2D; import processing.core.PMatrix3D; import processing.core.PShape; import processing.core.PShapeSVG; diff --git a/core/src/processing/opengl/PGraphics3D.java b/core/src/processing/opengl/PGraphics3D.java index 2e03f0a97..5a5e1c3b3 100644 --- a/core/src/processing/opengl/PGraphics3D.java +++ b/core/src/processing/opengl/PGraphics3D.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 42eac9da8..d778c1127 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/opengl/PShader.java b/core/src/processing/opengl/PShader.java index 1b5a2a9b5..c3e47ead5 100644 --- a/core/src/processing/opengl/PShader.java +++ b/core/src/processing/opengl/PShader.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/core/src/processing/opengl/PShapeOpenGL.java index d4d51fbab..ed64ce032 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/core/src/processing/opengl/PShapeOpenGL.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-15 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/opengl/PSurfaceGLES.java b/core/src/processing/opengl/PSurfaceGLES.java index 17d0e505d..b9a86ae87 100644 --- a/core/src/processing/opengl/PSurfaceGLES.java +++ b/core/src/processing/opengl/PSurfaceGLES.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,6 @@ import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.opengles.GL10; - import android.app.ActivityManager; import android.content.Context; import android.content.pm.ConfigurationInfo; @@ -40,6 +39,7 @@ import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.View; + import processing.android.AppComponent; import processing.android.PFragment; import processing.core.PApplet; diff --git a/core/src/processing/opengl/Texture.java b/core/src/processing/opengl/Texture.java index e6e84c6ba..29d8ba4c5 100644 --- a/core/src/processing/opengl/Texture.java +++ b/core/src/processing/opengl/Texture.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/core/src/processing/opengl/VertexBuffer.java b/core/src/processing/opengl/VertexBuffer.java index e4ef85b9c..114428b03 100644 --- a/core/src/processing/opengl/VertexBuffer.java +++ b/core/src/processing/opengl/VertexBuffer.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology diff --git a/debug/apps/arscene/build.gradle b/debug/apps/arscene/build.gradle index e7b1e8144..2a123c1f9 100644 --- a/debug/apps/arscene/build.gradle +++ b/debug/apps/arscene/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "processing.tests.arscene" minSdkVersion 23 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "1.0" } @@ -25,10 +25,9 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation project(':libs:processing-core') implementation project(':libs:processing-ar') - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support:design:28.0.0' - implementation 'com.google.ar:core:1.12.0' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.ar:core:1.22.0' } diff --git a/debug/apps/arscene/gradle.properties b/debug/apps/arscene/gradle.properties new file mode 100644 index 000000000..5465fec0e --- /dev/null +++ b/debug/apps/arscene/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/debug/apps/arscene/src/main/java/arscene/MainActivity.java b/debug/apps/arscene/src/main/java/arscene/MainActivity.java index 920ac14e3..b7127b85f 100644 --- a/debug/apps/arscene/src/main/java/arscene/MainActivity.java +++ b/debug/apps/arscene/src/main/java/arscene/MainActivity.java @@ -6,13 +6,14 @@ import android.os.Bundle; import android.content.Intent; import android.provider.Settings; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; import android.view.ViewGroup; import android.widget.FrameLayout; -import android.support.v7.app.AppCompatActivity; import android.widget.Toast; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + import processing.android.PFragment; import processing.android.CompatUtils; import processing.core.PApplet; @@ -60,6 +61,7 @@ public void onRequestPermissionsResult(int requestCode, String permissions[], in @Override public void onNewIntent(Intent intent) { + super.onNewIntent(intent); if (sketch != null) { sketch.onNewIntent(intent); } @@ -67,6 +69,7 @@ public void onNewIntent(Intent intent) { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); if (sketch != null) { sketch.onActivityResult(requestCode, resultCode, data); } diff --git a/debug/apps/fast2d/build.gradle b/debug/apps/fast2d/build.gradle index 404e094ab..3c735f125 100644 --- a/debug/apps/fast2d/build.gradle +++ b/debug/apps/fast2d/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "processing.tests.fast2d" minSdkVersion 17 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "1.0" } @@ -25,7 +25,7 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation project(':libs:processing-core') - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' } diff --git a/debug/apps/fast2d/gradle.properties b/debug/apps/fast2d/gradle.properties new file mode 100644 index 000000000..5465fec0e --- /dev/null +++ b/debug/apps/fast2d/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/debug/apps/fast2d/src/main/java/fast2d/MainActivity.java b/debug/apps/fast2d/src/main/java/fast2d/MainActivity.java index 000cb2349..91a930307 100644 --- a/debug/apps/fast2d/src/main/java/fast2d/MainActivity.java +++ b/debug/apps/fast2d/src/main/java/fast2d/MainActivity.java @@ -4,7 +4,7 @@ import android.content.Intent; import android.view.ViewGroup; import android.widget.FrameLayout; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import processing.android.PFragment; import processing.android.CompatUtils; @@ -80,6 +80,7 @@ public void onRequestPermissionsResult(int requestCode, String permissions[], in @Override public void onNewIntent(Intent intent) { + super.onNewIntent(intent); if (sketch != null) { sketch.onNewIntent(intent); } @@ -87,6 +88,7 @@ public void onNewIntent(Intent intent) { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); if (sketch != null) { sketch.onActivityResult(requestCode, resultCode, data); } diff --git a/debug/apps/fast2d/src/main/java/fast2d/Sketch.java b/debug/apps/fast2d/src/main/java/fast2d/Sketch.java index 0c07ff09c..4bd118d34 100644 --- a/debug/apps/fast2d/src/main/java/fast2d/Sketch.java +++ b/debug/apps/fast2d/src/main/java/fast2d/Sketch.java @@ -543,9 +543,9 @@ public void keyPressed() { } else if (key == 'f') { mode = CLOSE; } else if (key == 't') { - PGraphics2DX.premultiplyMatrices = true; +// PGraphics2DX.premultiplyMatrices = true; } else if (key == 'g') { - PGraphics2DX.premultiplyMatrices = false; +// PGraphics2DX.premultiplyMatrices = false; } else if (key == ' ') { // PJOGL pgl = (PJOGL)((PGraphics2D)this.g).pgl; // if (wireframe) diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchShapeBenchmark.java b/debug/apps/fast2d/src/main/java/fast2d/SketchShapeBenchmark.java index 9997e89fb..8f21dae08 100644 --- a/debug/apps/fast2d/src/main/java/fast2d/SketchShapeBenchmark.java +++ b/debug/apps/fast2d/src/main/java/fast2d/SketchShapeBenchmark.java @@ -23,7 +23,7 @@ public void settings() { public void setup() { strokeCap(cap); strokeJoin(join); - PGraphics2DX.premultiplyMatrices = premultiply; +// PGraphics2DX.premultiplyMatrices = premultiply; textFont(createFont("SansSerif", 15 * displayDensity)); } diff --git a/debug/apps/simple/build.gradle b/debug/apps/simple/build.gradle index cd6a3ee21..20e8b60cc 100644 --- a/debug/apps/simple/build.gradle +++ b/debug/apps/simple/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "processing.tests.simple" minSdkVersion 17 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "1.0" } @@ -25,7 +25,7 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation project(':libs:processing-core') - implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' } diff --git a/debug/apps/simple/gradle.properties b/debug/apps/simple/gradle.properties new file mode 100644 index 000000000..5465fec0e --- /dev/null +++ b/debug/apps/simple/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/debug/apps/simple/src/main/java/simple/MainActivity.java b/debug/apps/simple/src/main/java/simple/MainActivity.java index abd9278f9..49eba36c7 100644 --- a/debug/apps/simple/src/main/java/simple/MainActivity.java +++ b/debug/apps/simple/src/main/java/simple/MainActivity.java @@ -4,7 +4,7 @@ import android.content.Intent; import android.view.ViewGroup; import android.widget.FrameLayout; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import processing.android.PFragment; import processing.android.CompatUtils; @@ -36,6 +36,7 @@ public void onRequestPermissionsResult(int requestCode, String permissions[], in @Override public void onNewIntent(Intent intent) { + super.onNewIntent(intent); if (sketch != null) { sketch.onNewIntent(intent); } @@ -43,6 +44,7 @@ public void onNewIntent(Intent intent) { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); if (sketch != null) { sketch.onActivityResult(requestCode, resultCode, data); } diff --git a/debug/apps/vrcube/build.gradle b/debug/apps/vrcube/build.gradle index 70106023a..33401996c 100644 --- a/debug/apps/vrcube/build.gradle +++ b/debug/apps/vrcube/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "processing.tests.vrcube" minSdkVersion 19 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "1.0" } @@ -25,10 +25,9 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation project(':libs:processing-core') implementation project(':libs:processing-vr') - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support:design:28.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.google.vr:sdk-base:1.180.0' } diff --git a/debug/apps/vrcube/gradle.properties b/debug/apps/vrcube/gradle.properties new file mode 100644 index 000000000..5465fec0e --- /dev/null +++ b/debug/apps/vrcube/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/debug/apps/wallpaper/build.gradle b/debug/apps/wallpaper/build.gradle index 5a92e7174..c050f8d72 100644 --- a/debug/apps/wallpaper/build.gradle +++ b/debug/apps/wallpaper/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "processing.tests.wallpaper" minSdkVersion 17 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "1.0" } @@ -25,7 +25,7 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation project(':libs:processing-core') - implementation 'com.android.support:appcompat-v7:28.0.0' -} + implementation 'androidx.appcompat:appcompat:1.2.0' +} \ No newline at end of file diff --git a/debug/apps/wallpaper/gradle.properties b/debug/apps/wallpaper/gradle.properties new file mode 100644 index 000000000..5465fec0e --- /dev/null +++ b/debug/apps/wallpaper/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/debug/apps/wallpaper/src/main/java/wallpaper/DebuggerEntryPointActivity.java b/debug/apps/wallpaper/src/main/java/wallpaper/DebuggerEntryPointActivity.java index 3d4ef3959..ca80b0079 100644 --- a/debug/apps/wallpaper/src/main/java/wallpaper/DebuggerEntryPointActivity.java +++ b/debug/apps/wallpaper/src/main/java/wallpaper/DebuggerEntryPointActivity.java @@ -2,7 +2,7 @@ import android.app.Activity; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; public class DebuggerEntryPointActivity extends Activity { @Override diff --git a/debug/apps/watchface/build.gradle b/debug/apps/watchface/build.gradle index 075c005be..f8f450bc1 100644 --- a/debug/apps/watchface/build.gradle +++ b/debug/apps/watchface/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "processing.tests.watchface" minSdkVersion 25 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "1.0" multiDexEnabled true @@ -26,13 +26,9 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation project(':libs:processing-core') - implementation 'com.android.support:palette-v7:28.0.0' - implementation 'com.android.support:support-v4:28.0.0' - implementation 'com.google.android.gms:play-services-wearable:16.0.1' - implementation 'com.android.support:percent:28.0.0' - implementation 'com.android.support:recyclerview-v7:28.0.0' - implementation 'com.google.android.support:wearable:2.4.0' - compileOnly 'com.google.android.wearable:wearable:2.4.0' + implementation 'com.google.android.gms:play-services-wearable:17.0.0' + implementation 'com.google.android.support:wearable:2.8.1' + compileOnly 'com.google.android.wearable:wearable:2.8.1' } diff --git a/debug/apps/watchface/gradle.properties b/debug/apps/watchface/gradle.properties new file mode 100644 index 000000000..5465fec0e --- /dev/null +++ b/debug/apps/watchface/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/debug/build.gradle b/debug/build.gradle index 3a7763413..69d21f18f 100644 --- a/debug/build.gradle +++ b/debug/build.gradle @@ -2,11 +2,11 @@ buildscript { repositories { - jcenter() google() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.1' + classpath 'com.android.tools.build:gradle:4.1.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -15,11 +15,14 @@ buildscript { allprojects { repositories { - // There is a problem in JCenter with some Android pacakges, using the following maven repo + // There is a problem in JCenter with some Android packages, using the following maven repo // fixes the issue: // https://stackoverflow.com/questions/50563338/could-not-find-runtime-jar-android-arch-lifecycleruntime1-0-0/50564224 maven { url "https://maven.google.com" } + // Apparently needed by AndroidX dependencies + maven { url "https://jitpack.io" } + jcenter() google() } diff --git a/debug/gradle.properties b/debug/gradle.properties new file mode 100644 index 000000000..84242e19d --- /dev/null +++ b/debug/gradle.properties @@ -0,0 +1,15 @@ +## For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx1024m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +#Wed Dec 30 11:02:34 EST 2020 +android.enableJetifier=true +android.useAndroidX=true diff --git a/debug/libs/processing-ar/build.gradle b/debug/libs/processing-ar/build.gradle index 9349755e0..9974ed113 100755 --- a/debug/libs/processing-ar/build.gradle +++ b/debug/libs/processing-ar/build.gradle @@ -1,10 +1,10 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { minSdkVersion 19 - targetSdkVersion 28 + targetSdkVersion 29 } sourceSets { main { @@ -23,5 +23,5 @@ android { dependencies { implementation project(':libs:processing-core') - implementation 'com.google.ar:core:1.12.0' + implementation 'com.google.ar:core:1.22.0' } \ No newline at end of file diff --git a/debug/libs/processing-ar/gradle.properties b/debug/libs/processing-ar/gradle.properties index 9ddf7995d..0b8af424f 100755 --- a/debug/libs/processing-ar/gradle.properties +++ b/debug/libs/processing-ar/gradle.properties @@ -1,3 +1,5 @@ POM_NAME=Processing for Android AR Library POM_ARTIFACT_ID=processing-ar -POM_PACKAGING=aar \ No newline at end of file +POM_PACKAGING=aar +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/debug/libs/processing-core/build.gradle b/debug/libs/processing-core/build.gradle index 44381eec1..beadab8b9 100644 --- a/debug/libs/processing-core/build.gradle +++ b/debug/libs/processing-core/build.gradle @@ -1,10 +1,10 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { minSdkVersion 17 - targetSdkVersion 28 + targetSdkVersion 29 } sourceSets { main { @@ -22,7 +22,7 @@ android { } dependencies { - implementation "com.android.support:support-v4:28.0.0" - implementation 'com.google.android.support:wearable:2.4.0' - compileOnly 'com.google.android.wearable:wearable:2.4.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.support:wearable:2.8.1' + compileOnly 'com.google.android.wearable:wearable:2.8.1' } \ No newline at end of file diff --git a/debug/libs/processing-core/gradle.properties b/debug/libs/processing-core/gradle.properties index f93e4dd7f..7420d96aa 100755 --- a/debug/libs/processing-core/gradle.properties +++ b/debug/libs/processing-core/gradle.properties @@ -1,3 +1,5 @@ POM_NAME=Processing for Android Core Library POM_ARTIFACT_ID=processing-core -POM_PACKAGING=aar \ No newline at end of file +POM_PACKAGING=aar +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/debug/libs/processing-vr/build.gradle b/debug/libs/processing-vr/build.gradle index de829b3f0..81b91cbd0 100644 --- a/debug/libs/processing-vr/build.gradle +++ b/debug/libs/processing-vr/build.gradle @@ -1,10 +1,10 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { minSdkVersion 19 - targetSdkVersion 28 + targetSdkVersion 29 } sourceSets { main { diff --git a/debug/libs/processing-vr/gradle.properties b/debug/libs/processing-vr/gradle.properties index 947083428..66fa090a2 100755 --- a/debug/libs/processing-vr/gradle.properties +++ b/debug/libs/processing-vr/gradle.properties @@ -1,3 +1,5 @@ POM_NAME=Processing for Android VR Library POM_ARTIFACT_ID=processing-vr -POM_PACKAGING=aar \ No newline at end of file +POM_PACKAGING=aar +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..61bf46136 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +android.enableJetifier=true +android.useAndroidX=true +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 99340b4ad..5c2d1cf01 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2c2bbe5f9..4d9ca1649 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip diff --git a/gradlew b/gradlew index cccdd3d51..83f2acfdc 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# 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. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/gradlew.bat b/gradlew.bat index e95643d6a..24467a141 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/mode/.classpath b/mode/.classpath index dd1c6f232..104768529 100644 --- a/mode/.classpath +++ b/mode/.classpath @@ -6,7 +6,7 @@ - + diff --git a/mode/build.gradle b/mode/build.gradle index eea310ae0..ea7ee8f6f 100644 --- a/mode/build.gradle +++ b/mode/build.gradle @@ -6,27 +6,27 @@ import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; // Extend compile to copy the jars from gradle-tooling and slf4j: // https://stackoverflow.com/a/43602463 configurations { - compile.extendsFrom compileAndCopy - compile.extendsFrom compileAndExtract + implementation.extendsFrom implementationCopy + implementation.extendsFrom implementationExtract } dependencies { - compile group: "org.processing", name: "core", version: "${processingVersion}" - compile group: "org.processing", name: "pde", version: "${processingVersion}" - compile group: "org.processing", name: "java-mode", version: "${processingVersion}" + implementation group: "org.processing", name: "core", version: "${processingVersion}" + implementation group: "org.processing", name: "pde", version: "${processingVersion}" + implementation group: "org.processing", name: "java-mode", version: "${processingVersion}" - compileAndExtract "org.eclipse.jdt:org.eclipse.jdt.debug:${jdtVersion}" + implementationExtract "org.eclipse.jdt:org.eclipse.jdt.debug:${jdtVersion}" - compileAndCopy "org.gradle:gradle-tooling-api:${toolingVersion}" - compileAndCopy "org.slf4j:slf4j-api:${slf4jVersion}" - compileAndCopy "org.slf4j:slf4j-simple:${slf4jVersion}" + implementationCopy "org.gradle:gradle-tooling-api:${toolingVersion}" + implementationCopy "org.slf4j:slf4j-api:${slf4jVersion}" + implementationCopy "org.slf4j:slf4j-simple:${slf4jVersion}" - compile fileTree(include: ["jdi.jar", "jdimodel.jar"], dir: 'mode') + implementation fileTree(include: ["jdi.jar", "jdimodel.jar"], dir: 'mode') } // This task copies the gradle tooling jar into the mode folder task copyToLib(type: Copy) { - from configurations.compileAndCopy.files + from configurations.implementationCopy.files into "mode" } build.dependsOn(copyToLib) @@ -42,7 +42,7 @@ sourceSets { task getjdi(type: Copy) { // This task extracts the jar files inside org.eclipse.jdt.debug, which are // jdi.jar and jdimodel.jar and needed to build the debugger. - from(zipTree(configurations.compileAndExtract.files[0])) { + from(zipTree(configurations.implementationExtract.files[0])) { include '**/*.jar' exclude 'META-INF' } diff --git a/mode/languages/mode.properties b/mode/languages/mode.properties index 599153109..df7d0670e 100644 --- a/mode/languages/mode.properties +++ b/mode/languages/mode.properties @@ -174,6 +174,7 @@ android_sdk.error.missing_build_tools_folder = There is no build-tools folder in android_sdk.error.missing_platforms_folder = There is no platforms folder in %s android_sdk.error.missing_target_platform = There is no Android %s in %s android_sdk.error.missing_android_jar = android.jar for plaform %s is missing from %s +android_sdk.error.missing_emulator = The emulator files are missing android_debugger.info.removing_expired_keystore = Removing expired debug.keystore file. android_debugger.error.cannot_remove_expired_keystore = Could not remove the expired debug.keystore file. android_debugger.error.request_removing_keystore = Please remove the file %s @@ -209,8 +210,6 @@ android_devices.error.no_permissions_body = Make sure that the device has USB de ""; private static final String DEVICE_PERMISSIONS_MESSAGE = - - # --------------------------------------- # Keystore manager @@ -283,3 +282,27 @@ download_property.change_event_total = total download_property.change_event_downloaded = downloaded download_prompt.cancel = Cancel download +# --------------------------------------- +# SDK Updater tool + +sdk_updater.name_column = Package name +sdk_updater.version_column = Installed version +sdk_updater.available_column = Available update + +sdk_updater.query_message = Querying packages... + +sdk_updater.no_updates_message = No updates available +sdk_updater.one_updates_message = 1 update found! +sdk_updater.many_updates_message = "%d" updates found! + +sdk_updater.warning_failed_finding_package = Failed to find package "%s" +sdk_updater.warning_failed_computing_dependency_list = Unable to compute a complete list of dependencies. + +sdk_updater.refresh_package_message = Refreshing packages... +sdk_updater.download_package_message = Downloading available updates... +sdk_updater.download_canceled_message = Download canceled + +sdk_updater.update_button_label = Update +sdk_updater.cancel_button_label = Cancel +sdk_updater.close_button_label = Close + diff --git a/mode/libraries/ar/build.gradle b/mode/libraries/ar/build.gradle index 85d2e3079..9616907c5 100644 --- a/mode/libraries/ar/build.gradle +++ b/mode/libraries/ar/build.gradle @@ -1,9 +1,8 @@ import java.nio.file.Files import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; -apply plugin: 'maven' apply plugin: 'aar' - +apply plugin: 'maven' dependencies { compileOnly name: "android" diff --git a/mode/libraries/vr/build.gradle b/mode/libraries/vr/build.gradle index e25a168da..c086225c0 100644 --- a/mode/libraries/vr/build.gradle +++ b/mode/libraries/vr/build.gradle @@ -1,8 +1,8 @@ import java.nio.file.Files import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; -apply plugin: 'maven' apply plugin: 'aar' +apply plugin: 'maven' dependencies { compileOnly name: "android" diff --git a/mode/mode.properties b/mode/mode.properties index 1ec1f4c89..d95ef4bde 100644 --- a/mode/mode.properties +++ b/mode/mode.properties @@ -4,7 +4,7 @@ url = http://android.processing.org sentence = Create projects with Processing for Android devices paragraph = This version of the Android Mode is for Processing 3.1+ imports=processing.mode.java.JavaMode -version = 277 -prettyVersion = 4.1.1 +version = 278 +prettyVersion = 4.2.0 minRevision = 249 maxRevision = 1269 diff --git a/mode/src/processing/mode/android/AVD.java b/mode/src/processing/mode/android/AVD.java index d012588b1..90bc6f81a 100644 --- a/mode/src/processing/mode/android/AVD.java +++ b/mode/src/processing/mode/android/AVD.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2013-16 The Processing Foundation + Copyright (c) 2013-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 diff --git a/mode/src/processing/mode/android/AndroidBuild.java b/mode/src/processing/mode/android/AndroidBuild.java index d52b822d0..3cbee090b 100644 --- a/mode/src/processing/mode/android/AndroidBuild.java +++ b/mode/src/processing/mode/android/AndroidBuild.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-17 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2009-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify @@ -63,7 +63,9 @@ class AndroidBuild extends JavaBuild { // Versions of all required dependencies static public String TARGET_SDK; static public String TARGET_PLATFORM; - static public String SUPPORT_VER; + static public String GRADLE_VER; + static public String APPCOMPAT_VER; + static public String V4LEGACY_VER; static public String PLAY_SERVICES_VER; static public String WEAR_VER; static public String GVR_VER; @@ -86,7 +88,9 @@ class AndroidBuild extends JavaBuild { static private final String XML_WATCHFACE_TEMPLATE = "XMLWatchFace.xml.tmpl"; // Gradle build files - static private final String GRADLE_SETTINGS_TEMPLATE = "Settings.gradle.tmpl"; + static private final String GRADLE_SETTINGS_TEMPLATE = "Settings.gradle.tmpl"; + static private final String GRADLE_PROPERTIES_TEMPLATE = "Properties.gradle.tmpl"; + static private final String LOCAL_PROPERTIES_TEMPLATE = "Properties.local.tmpl"; static private final String TOP_GRADLE_BUILD_TEMPLATE = "TopBuild.gradle.tmpl"; static private final String APP_GRADLE_BUILD_ECJ_TEMPLATE = "AppBuildECJ.gradle.tmpl"; static private final String APP_GRADLE_BUILD_TEMPLATE = "AppBuild.gradle.tmpl"; @@ -284,20 +288,37 @@ protected boolean gradleBuild() throws SketchException { private void createTopModule(String projectModules) - throws IOException { + throws IOException { + HashMap replaceMap = new HashMap(); + File buildTemplate = mode.getContentFile("templates/" + TOP_GRADLE_BUILD_TEMPLATE); File buildlFile = new File(tmpFolder, "build.gradle"); - Util.copyFile(buildTemplate, buildlFile); - - writeLocalProps(new File(tmpFolder, "local.properties")); - AndroidUtil.writeFile(new File(tmpFolder, "gradle.properties"), - new String[]{"org.gradle.jvmargs=-Xmx1536m"}); + replaceMap.put("@@gradle_version@@", GRADLE_VER); + AndroidUtil.createFileFromTemplate(buildTemplate, buildlFile, replaceMap); + + File gradlePropsTemplate = mode.getContentFile("templates/" + GRADLE_PROPERTIES_TEMPLATE); + File gradlePropsFile = new File(tmpFolder, "gradle.properties"); + Util.copyFile(gradlePropsTemplate, gradlePropsFile); - File settingsTemplate = mode.getContentFile("templates/" + GRADLE_SETTINGS_TEMPLATE); + File settingsTemplate = mode.getContentFile("templates/" + GRADLE_SETTINGS_TEMPLATE); File settingsFile = new File(tmpFolder, "settings.gradle"); - HashMap replaceMap = new HashMap(); - replaceMap.put("@@project_modules@@", projectModules); - AndroidUtil.createFileFromTemplate(settingsTemplate, settingsFile, replaceMap); + replaceMap.clear(); + replaceMap.put("@@project_modules@@", projectModules); + AndroidUtil.createFileFromTemplate(settingsTemplate, settingsFile, replaceMap); + + File localPropsTemplate = mode.getContentFile("templates/" + LOCAL_PROPERTIES_TEMPLATE); + File localPropsFile = new File(tmpFolder, "local.properties"); + replaceMap.clear(); + final String sdkPath = sdk.getFolder().getAbsolutePath(); + if (Platform.isWindows()) { + // Windows needs backslashes escaped, or it will also accept forward + // slashes in the build file. We're using the forward slashes since this + // path gets concatenated with a lot of others that use forwards anyway. + replaceMap.put("@@sdk_path@@", sdkPath.replace('\\', '/')); + } else { + replaceMap.put("@@sdk_path@@", sdkPath); + } + AndroidUtil.createFileFromTemplate(localPropsTemplate, localPropsFile, replaceMap); } @@ -321,15 +342,19 @@ private void createAppModule(String moduleName) tmplFile = exportProject ? APP_GRADLE_BUILD_TEMPLATE : APP_GRADLE_BUILD_ECJ_TEMPLATE; } + String toolPath = Base.getToolsFolder().getPath().replace('\\', '/'); + String platformPath = sdk.getTargetPlatform(TARGET_SDK).getPath().replace('\\', '/'); + File appBuildTemplate = mode.getContentFile("templates/" + tmplFile); File appBuildFile = new File(moduleFolder, "build.gradle"); HashMap replaceMap = new HashMap(); - replaceMap.put("@@tools_folder@@", Base.getToolsFolder().getPath().replace('\\', '/')); - replaceMap.put("@@target_platform@@", TARGET_SDK); + replaceMap.put("@@tools_folder@@", toolPath); + replaceMap.put("@@target_platform@@", platformPath); replaceMap.put("@@package_name@@", getPackageName()); replaceMap.put("@@min_sdk@@", minSdk); replaceMap.put("@@target_sdk@@", TARGET_SDK); - replaceMap.put("@@support_version@@", SUPPORT_VER); + replaceMap.put("@@appcompat_version@@", APPCOMPAT_VER); + replaceMap.put("@@v4legacy_version@@", V4LEGACY_VER); replaceMap.put("@@play_services_version@@", PLAY_SERVICES_VER); replaceMap.put("@@wear_version@@", WEAR_VER); replaceMap.put("@@gvr_version@@", GVR_VER); @@ -551,22 +576,6 @@ private void writeResXMLWatchFace(final File xmlFolder) { } - private void writeLocalProps(final File file) { - final PrintWriter writer = PApplet.createWriter(file); - final String sdkPath = sdk.getFolder().getAbsolutePath(); - if (Platform.isWindows()) { - // Windows needs backslashes escaped, or it will also accept forward - // slashes in the build file. We're using the forward slashes since this - // path gets concatenated with a lot of others that use forwards anyway. - writer.println("sdk.dir=" + sdkPath.replace('\\', '/')); - } else { - writer.println("sdk.dir=" + sdkPath); - } - writer.flush(); - writer.close(); - } - - private void writeRes(File resFolder) throws SketchException { File layoutFolder = AndroidUtil.createPath(resFolder, "layout"); writeResLayoutMainActivity(layoutFolder); @@ -898,9 +907,15 @@ static public void initVersions(File file) { MIN_SDK_AR = props.getProperty("android-min-ar"); MIN_SDK_WATCHFACE = props.getProperty("android-min-wear"); - // Versions of the target sdk, support, play services, wear, VR, and AR are stored in - // preferences file so they can be changed by the user without having to rebuilt/reinstall - // the mode. + // Versions strings of all dependencies are stored in a preferences file so they can be changed by the + // user without having to rebuild/reinstall the mode. + + GRADLE_VER = Preferences.get("android.gradle"); + String defGradleVersion = props.getProperty("gradle"); + if (GRADLE_VER == null || PApplet.parseInt(GRADLE_VER) != PApplet.parseInt(defGradleVersion)) { + GRADLE_VER = defGradleVersion; + Preferences.set("android.gradle", GRADLE_VER); + } TARGET_SDK = Preferences.get("android.sdk.target"); String defTargetSDK = props.getProperty("android-platform"); @@ -910,12 +925,19 @@ static public void initVersions(File file) { } TARGET_PLATFORM = "android-" + TARGET_SDK; - SUPPORT_VER = Preferences.get("android.sdk.support"); - String defSupportVer = props.getProperty("com.android.support%support-v4"); - if (SUPPORT_VER == null || !versionCheck(SUPPORT_VER, defSupportVer)) { - SUPPORT_VER = defSupportVer; - Preferences.set("android.sdk.support", SUPPORT_VER); - } + APPCOMPAT_VER = Preferences.get("android.sdk.appcompat"); + String defAppCompatVer = props.getProperty("androidx.appcompat%appcompat"); + if (APPCOMPAT_VER == null || !versionCheck(APPCOMPAT_VER, defAppCompatVer)) { + APPCOMPAT_VER = defAppCompatVer; + Preferences.set("android.sdk.appcompat", APPCOMPAT_VER); + } + + V4LEGACY_VER = Preferences.get("android.sdk.v4legacy"); + String defV4LegacyVer = props.getProperty("androidx.legacy%legacy-support-v4"); + if (V4LEGACY_VER == null || !versionCheck(V4LEGACY_VER, defV4LegacyVer)) { + V4LEGACY_VER = defV4LegacyVer; + Preferences.set("android.sdk.v4legacy", V4LEGACY_VER); + } PLAY_SERVICES_VER = Preferences.get("android.sdk.play_services"); String defPlayServicesVer = props.getProperty("com.google.android.gms%play-services-wearable"); diff --git a/mode/src/processing/mode/android/AndroidDebugger.java b/mode/src/processing/mode/android/AndroidDebugger.java index 927f4df37..08a5ec746 100644 --- a/mode/src/processing/mode/android/AndroidDebugger.java +++ b/mode/src/processing/mode/android/AndroidDebugger.java @@ -1,3 +1,24 @@ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + Part of the Processing project - http://processing.org + + Copyright (c) 2018-21 The Processing Foundation + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + package processing.mode.android; import com.sun.jdi.*; @@ -13,6 +34,7 @@ import java.io.IOException; +// Developed by Manav Jain as part of GSoC 2018 public class AndroidDebugger extends Debugger { /// editor window, acting as main view protected AndroidEditor editor; diff --git a/mode/src/processing/mode/android/AndroidEditor.java b/mode/src/processing/mode/android/AndroidEditor.java index 0044999e2..e9c366395 100644 --- a/mode/src/processing/mode/android/AndroidEditor.java +++ b/mode/src/processing/mode/android/AndroidEditor.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-17 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2009-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify @@ -47,7 +47,7 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; +import java.util.Arrays; import java.util.List; import java.util.TimerTask; @@ -82,13 +82,7 @@ protected AndroidEditor(Base base, String path, EditorState state, androidMode.resetUserSelection(); androidMode.checkSDK(this); - debugger = new AndroidDebugger(this, androidMode); - // Set saved breakpoints when sketch is opened for the first time - for (LineID lineID : stripBreakpointComments()) { - debugger.setBreakpoint(lineID); - } - - super.debugger = debugger; + initDebugger(); androidTools = loadAndroidTools(); addToolsToMenu(); @@ -595,16 +589,34 @@ private void loadModeSettings() { private List loadAndroidTools() { // This gets called before assigning mode to androidMode... ArrayList outgoing = new ArrayList(); - File toolPath = new File(androidMode.getFolder(), "tools/SDKUpdater"); - AndroidTool tool = null; - try { - tool = new AndroidTool(toolPath, androidMode.getSDK()); - tool.init(base); - outgoing.add(tool); - } catch (Throwable e) { - e.printStackTrace(); - } - Collections.sort(outgoing); + + File folder = new File(androidMode.getFolder(), "tools"); + String[] list = folder.list(); + if (list == null) { + return outgoing; + } + + Arrays.sort(list, String.CASE_INSENSITIVE_ORDER); + for (String name : list) { + if (name.charAt(0) == '.') { + continue; + } + + File toolPath = new File(folder, name); + if (toolPath.isDirectory()) { + File jarPath = new File(toolPath, "tool" + File.separator + name + ".jar"); + if (jarPath.exists()) { + try { + AndroidTool tool = new AndroidTool(toolPath, androidMode); + tool.init(base); + outgoing.add(tool); + } catch (Throwable e) { + e.printStackTrace(); + } + } + } + } + return outgoing; } @@ -642,6 +654,15 @@ public void actionPerformed(ActionEvent e) { androidMenu.add(item); } + private void initDebugger() { + debugger = new AndroidDebugger(this, androidMode); + // Set saved breakpoints when sketch is opened for the first time + for (LineID lineID : stripBreakpointComments()) { + debugger.setBreakpoint(lineID); + } + super.debugger = debugger; + + } class UpdateDeviceListTask extends TimerTask { diff --git a/mode/src/processing/mode/android/AndroidKeyStore.java b/mode/src/processing/mode/android/AndroidKeyStore.java index a57880418..2929d99fe 100644 --- a/mode/src/processing/mode/android/AndroidKeyStore.java +++ b/mode/src/processing/mode/android/AndroidKeyStore.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2014-16 The Processing Foundation + Copyright (c) 2014-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 diff --git a/mode/src/processing/mode/android/AndroidLineBreakpoint.java b/mode/src/processing/mode/android/AndroidLineBreakpoint.java index 2104543d9..3604c2cb1 100644 --- a/mode/src/processing/mode/android/AndroidLineBreakpoint.java +++ b/mode/src/processing/mode/android/AndroidLineBreakpoint.java @@ -1,3 +1,24 @@ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + Part of the Processing project - http://processing.org + + Copyright (c) 2018-21 The Processing Foundation + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + package processing.mode.android; import com.sun.jdi.ReferenceType; diff --git a/mode/src/processing/mode/android/AndroidMode.java b/mode/src/processing/mode/android/AndroidMode.java index b8809c8e1..574bf1c7c 100644 --- a/mode/src/processing/mode/android/AndroidMode.java +++ b/mode/src/processing/mode/android/AndroidMode.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-17 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2011-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify @@ -189,6 +189,12 @@ public AndroidSDK getSDK() { return sdk; } + + public String getModeJar() { + String modePath = new File(getFolder(), "mode").getAbsolutePath(); + return modePath + File.separator + "AndroidMode.jar"; + } + @Override public String getSearchPath() { @@ -397,7 +403,12 @@ private void loadTextStrings() { } static public String getTextString(String key) { - return textStrings.get(key); + if (textStrings.containsKey(key)) { + return textStrings.get(key); + } else { + return key; + } + // return Language.text(key); } diff --git a/mode/src/processing/mode/android/AndroidPreprocessor.java b/mode/src/processing/mode/android/AndroidPreprocessor.java index bf15fcf91..b134a7a2f 100644 --- a/mode/src/processing/mode/android/AndroidPreprocessor.java +++ b/mode/src/processing/mode/android/AndroidPreprocessor.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-17 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2009-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify diff --git a/mode/src/processing/mode/android/AndroidRunner.java b/mode/src/processing/mode/android/AndroidRunner.java index df6f019d6..284c0dc5b 100644 --- a/mode/src/processing/mode/android/AndroidRunner.java +++ b/mode/src/processing/mode/android/AndroidRunner.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-17 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2011-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify diff --git a/mode/src/processing/mode/android/AndroidSDK.java b/mode/src/processing/mode/android/AndroidSDK.java index e7ff9b875..6274810fe 100644 --- a/mode/src/processing/mode/android/AndroidSDK.java +++ b/mode/src/processing/mode/android/AndroidSDK.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2013-17 The Processing Foundation + Copyright (c) 2013-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 @@ -58,13 +58,13 @@ class AndroidSDK { final static private int TEXT_MARGIN = Toolkit.zoom(8); final static private int TEXT_WIDTH = Toolkit.zoom(300); - private final File folder; - private final File tools; + private final File folder; private final File platforms; private final File highestPlatform; private final File androidJar; private final File platformTools; private final File buildTools; + private final File cmdlineTools; private final File avdManager; private final File sdkManager; private final File emulator; @@ -99,10 +99,13 @@ public AndroidSDK(File folder) throws BadSDKException, IOException { throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_sdk_folder", folder)); } - tools = new File(folder, "tools"); - if (!tools.exists()) { - throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_tools_folder", folder)); - } + File tmp = new File(folder, "cmdline-tools/latest"); + if (!tmp.exists()) { + tmp = new File(folder, "tools"); + } else if (!tmp.exists()) { + throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_tools_folder", folder)); + } + cmdlineTools = tmp; platformTools = new File(folder, "platform-tools"); if (!platformTools.exists()) { @@ -141,23 +144,33 @@ public AndroidSDK(File folder) throws BadSDKException, IOException { AndroidBuild.TARGET_SDK, highestPlatform.getAbsolutePath())); } - avdManager = findCliTool(new File(tools, "bin"), "avdmanager"); - sdkManager = findCliTool(new File(tools, "bin"), "sdkmanager"); + avdManager = findCliTool(new File(cmdlineTools, "bin"), "avdmanager"); + sdkManager = findCliTool(new File(cmdlineTools, "bin"), "sdkmanager"); File emuFolder = new File(folder, "emulator"); if (emuFolder.exists()) { // First try the new location of the emulator inside its own folder emulator = findCliTool(emuFolder, "emulator"); } else { - // If not found, use old location inside tools - emulator = findCliTool(tools, "emulator"); + // If not found, use old location inside tools as fallback + emuFolder = new File(cmdlineTools, "emulator"); + if (emuFolder.exists()) { + emulator = findCliTool(cmdlineTools, "emulator"); + } else { + emulator = null; + if (SDKDownloader.DOWNLOAD_EMU) { + // Only throw an exception if the downloader was supposed to download the emulator + throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_emulator", + AndroidBuild.TARGET_SDK, highestPlatform.getAbsolutePath())); + } + } } String path = Platform.getenv("PATH"); Platform.setenv("ANDROID_SDK", folder.getCanonicalPath()); path = platformTools.getCanonicalPath() + File.pathSeparator + - tools.getCanonicalPath() + File.pathSeparator + path; + cmdlineTools.getCanonicalPath() + File.pathSeparator + path; String javaHomeProp = System.getProperty("java.home"); File javaHome = new File(javaHomeProp).getCanonicalFile(); @@ -243,8 +256,8 @@ public File getAndroidJarPath() { } - public File getToolsFolder() { - return tools; + public File getCommandLineToolsFolder() { + return cmdlineTools; } @@ -263,6 +276,11 @@ public File getHighestPlatform() { } + public File getTargetPlatform(String target) { + return new File(platforms, "android-" + target); + } + + public File getZipAlignTool() { File[] files = buildTools.listFiles(); String name = Platform.isWindows() ? "zipalign.exe" : "zipalign"; @@ -275,13 +293,18 @@ public File getZipAlignTool() { // Write to the process input, so the licenses will be accepted. In - // principle, We only need 7 'y', one for the 'yes' to the first + // principle, we only need 7 'y', one for the 'yes' to the first // 'review licenses?' question, the rest for the 6 licenses, but adding // 10 just in case, having more does not cause any trouble. private static final String response = "y\ny\ny\ny\ny\ny\ny\ny\ny\ny\n"; private void acceptLicenses() { - ProcessBuilder pb = new ProcessBuilder(sdkManager.getAbsolutePath(), "--licenses"); + final String[] cmd = new String[] { + sdkManager.getAbsolutePath(), + "--licenses" + }; + + ProcessBuilder pb = new ProcessBuilder(cmd); pb.redirectErrorStream(true); try { Process process = pb.start(); @@ -300,7 +323,7 @@ public void run() { } } }, "AndroidSDK: reading licenses").start(); - Thread.sleep(1000); + Thread.sleep(3000); os.write(response.getBytes()); os.flush(); os.close(); @@ -478,7 +501,7 @@ static public AndroidSDK download(final Frame editor, final AndroidMode androidM final int result = showSDKLicenseDialog(editor); if (result == JOptionPane.YES_OPTION) { - sdk.acceptLicenses(); + sdk.acceptLicenses(); String msg = AndroidMode.getTextString("android_sdk.dialog.sdk_installed_body", PROCESSING_FOR_ANDROID_URL, WHATS_NEW_URL); File driver = AndroidSDK.getGoogleDriverFolder(); if (Platform.isWindows() && driver.exists()) { diff --git a/mode/src/processing/mode/android/AndroidTool.java b/mode/src/processing/mode/android/AndroidTool.java index f463bf07f..3dbdb932b 100644 --- a/mode/src/processing/mode/android/AndroidTool.java +++ b/mode/src/processing/mode/android/AndroidTool.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2017 The Processing Foundation + Copyright (c) 2017-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 @@ -37,13 +37,13 @@ * Specialized local contribution for Android tools. Cannot use ToolContribution * from processing-app since Android tools may need SDK jars in the classpath. */ -public class AndroidTool extends LocalContribution implements Tool, Comparable { - private AndroidSDK sdk; +public class AndroidTool extends LocalContribution implements Tool, Comparable { private Tool tool; + private AndroidMode mode; - AndroidTool(File toolFolder, AndroidSDK sdk) throws Throwable { + AndroidTool(File toolFolder, AndroidMode androidMode) throws Throwable { super(toolFolder); - this.sdk = sdk; + this.mode = androidMode; String className = initLoader(null); if (className != null) { @@ -86,16 +86,16 @@ public String initLoader(String className) throws Exception { " class inside " + mainJar.getAbsolutePath()); } } - - // Add .jar and .zip files from the "tool" and the SDK/tools/lib + + // Add .jar and .zip files from the "tool" and the tools/lib // folder into the classpath - File libDir = new File(sdk.getToolsFolder(), "lib"); + File libDir = new File(folder, "lib"); File[] toolArchives = Util.listJarFiles(toolDir); File[] libArchives = Util.listJarFiles(libDir); if (toolArchives != null && toolArchives.length > 0 && libArchives != null && libArchives.length > 0) { - URL[] urlList = new URL[toolArchives.length + libArchives.length]; + URL[] urlList = new URL[toolArchives.length + libArchives.length + 1]; int j; for (j = 0; j < toolArchives.length; j++) { @@ -106,6 +106,11 @@ public String initLoader(String className) throws Exception { Messages.log("Found archive " + libArchives[k] + " for " + getName()); urlList[j] = libArchives[k].toURI().toURL(); } + urlList[urlList.length - 1] = new File(mode.getModeJar()).toURI().toURL(); + + +// String modePath = new File(dmode.getFolder(), "mode").getAbsolutePath(); +// urlList[urlList.length - 1] = new File(modePath + File.separator + "JavaMode.jar").toURI().toURL(); loader = new URLClassLoader(urlList); Messages.log("loading above JARs with loader " + loader); diff --git a/mode/src/processing/mode/android/AndroidToolbar.java b/mode/src/processing/mode/android/AndroidToolbar.java index b0335681a..8632f7689 100644 --- a/mode/src/processing/mode/android/AndroidToolbar.java +++ b/mode/src/processing/mode/android/AndroidToolbar.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2011-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify diff --git a/mode/src/processing/mode/android/AndroidUtil.java b/mode/src/processing/mode/android/AndroidUtil.java index 32285f639..80772bafb 100644 --- a/mode/src/processing/mode/android/AndroidUtil.java +++ b/mode/src/processing/mode/android/AndroidUtil.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2017 The Processing Foundation + Copyright (c) 2017-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 @@ -31,7 +31,9 @@ import java.util.HashMap; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; - +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; + import javax.swing.JEditorPane; import javax.swing.JLabel; import javax.swing.JOptionPane; @@ -295,5 +297,13 @@ static public boolean noFileExists(File[] files) { if (f.exists()) return false; } return true; - } + } + + static public void moveDir(File from, File to) { + try { + Files.move(from.toPath(), to.toPath(), StandardCopyOption.REPLACE_EXISTING); + } catch (IOException ex) { + ex.printStackTrace(); + } + } } diff --git a/mode/src/processing/mode/android/Commander.java b/mode/src/processing/mode/android/Commander.java index 3b25c5c4e..07264a1a9 100644 --- a/mode/src/processing/mode/android/Commander.java +++ b/mode/src/processing/mode/android/Commander.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2008-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify diff --git a/mode/src/processing/mode/android/Device.java b/mode/src/processing/mode/android/Device.java index c24554a73..5298d6594 100644 --- a/mode/src/processing/mode/android/Device.java +++ b/mode/src/processing/mode/android/Device.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2013-16 The Processing Foundation + Copyright (c) 2013-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 diff --git a/mode/src/processing/mode/android/DeviceListener.java b/mode/src/processing/mode/android/DeviceListener.java index 83b979dcf..f6be233be 100644 --- a/mode/src/processing/mode/android/DeviceListener.java +++ b/mode/src/processing/mode/android/DeviceListener.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2013-16 The Processing Foundation + Copyright (c) 2013-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 diff --git a/mode/src/processing/mode/android/Devices.java b/mode/src/processing/mode/android/Devices.java index 2ac876875..c893f1de0 100644 --- a/mode/src/processing/mode/android/Devices.java +++ b/mode/src/processing/mode/android/Devices.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2013-16 The Processing Foundation + Copyright (c) 2013-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 diff --git a/mode/src/processing/mode/android/EmulatorController.java b/mode/src/processing/mode/android/EmulatorController.java index 60f3e57f4..c1a7121ef 100644 --- a/mode/src/processing/mode/android/EmulatorController.java +++ b/mode/src/processing/mode/android/EmulatorController.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2013-16 The Processing Foundation + Copyright (c) 2013-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 @@ -75,6 +75,11 @@ synchronized public void launch(final AndroidSDK sdk, final boolean wear) String gpuFlag = "auto"; final File emulator = sdk.getEmulatorTool(); + if (emulator == null || emulator.exists()) { + System.err.println("EmulatorController: Emulator is not available."); + return; + } + final String[] cmd = new String[] { emulator.getCanonicalPath(), "-avd", avdName, diff --git a/mode/src/processing/mode/android/JarSigner.java b/mode/src/processing/mode/android/JarSigner.java index c50022b69..17e22de66 100644 --- a/mode/src/processing/mode/android/JarSigner.java +++ b/mode/src/processing/mode/android/JarSigner.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2014-16 The Processing Foundation + Copyright (c) 2014-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 diff --git a/mode/src/processing/mode/android/KeyStoreManager.java b/mode/src/processing/mode/android/KeyStoreManager.java index fc04a4aae..d32f42e0a 100644 --- a/mode/src/processing/mode/android/KeyStoreManager.java +++ b/mode/src/processing/mode/android/KeyStoreManager.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2014-17 The Processing Foundation + Copyright (c) 2014-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 diff --git a/mode/src/processing/mode/android/Keys.java b/mode/src/processing/mode/android/Keys.java index fd20cbd30..02b796227 100644 --- a/mode/src/processing/mode/android/Keys.java +++ b/mode/src/processing/mode/android/Keys.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2010-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify diff --git a/mode/src/processing/mode/android/LogEntry.java b/mode/src/processing/mode/android/LogEntry.java index 86048343d..e4b0fd51c 100644 --- a/mode/src/processing/mode/android/LogEntry.java +++ b/mode/src/processing/mode/android/LogEntry.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2013-16 The Processing Foundation + Copyright (c) 2013-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 diff --git a/mode/src/processing/mode/android/Manifest.java b/mode/src/processing/mode/android/Manifest.java index e63d06da4..c50075fee 100644 --- a/mode/src/processing/mode/android/Manifest.java +++ b/mode/src/processing/mode/android/Manifest.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-17 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2010-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify diff --git a/mode/src/processing/mode/android/Permissions.java b/mode/src/processing/mode/android/Permissions.java index 160ec1eb1..3c08f5950 100644 --- a/mode/src/processing/mode/android/Permissions.java +++ b/mode/src/processing/mode/android/Permissions.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2012-16 The Processing Foundation + Copyright (c) 2012-21 The Processing Foundation Copyright (c) 2010-12 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify diff --git a/mode/src/processing/mode/android/SDKDownloader.java b/mode/src/processing/mode/android/SDKDownloader.java index c42f3b5e5..6fa2d30d8 100644 --- a/mode/src/processing/mode/android/SDKDownloader.java +++ b/mode/src/processing/mode/android/SDKDownloader.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2014-17 The Processing Foundation + Copyright (c) 2014-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 @@ -65,6 +65,8 @@ public class SDKDownloader extends JDialog implements PropertyChangeListener { private static final String HAXM_URL = "https://dl.google.com/android/repository/extras/intel/"; private static final String REPOSITORY_LIST = "repository2-1.xml"; private static final String ADDON_LIST = "addon2-1.xml"; + + public static final boolean DOWNLOAD_EMU = false; private JProgressBar progressBar; private JLabel downloadedTextArea; @@ -79,8 +81,8 @@ public class SDKDownloader extends JDialog implements PropertyChangeListener { class SDKUrlHolder { public String platformVersion, buildToolsVersion; - public String platformToolsUrl, buildToolsUrl, platformUrl, toolsUrl, emulatorUrl; - public String platformToolsFilename, buildToolsFilename, platformFilename, toolsFilename, emulatorFilename; + public String platformToolsUrl, buildToolsUrl, platformUrl, cmdlineToolsUrl, emulatorUrl; + public String platformToolsFilename, buildToolsFilename, platformFilename, cmdlineToolsFilename, emulatorFilename; public String usbDriverUrl; public String usbDriverFilename; public String haxmFilename, haxmUrl; @@ -105,14 +107,17 @@ protected Object doInBackground() throws Exception { if (!platformsFolder.exists()) platformsFolder.mkdir(); File buildToolsFolder = new File(sdkFolder, "build-tools"); if (!buildToolsFolder.exists()) buildToolsFolder.mkdir(); - File emulatorFolder = new File(sdkFolder, "emulator"); - if (!emulatorFolder.exists()) emulatorFolder.mkdir(); File extrasFolder = new File(sdkFolder, "extras"); if (!extrasFolder.exists()) extrasFolder.mkdir(); File googleRepoFolder = new File(extrasFolder, "google"); if (!googleRepoFolder.exists()) googleRepoFolder.mkdir(); File haxmFolder = new File(extrasFolder, "intel/HAXM"); if (!haxmFolder.exists()) haxmFolder.mkdirs(); + + if (DOWNLOAD_EMU) { + File emulatorFolder = new File(sdkFolder, "emulator"); + if (!emulatorFolder.exists()) emulatorFolder.mkdir(); + } // creating temp folder for downloaded zip packages File tempFolder = new File(androidFolder, "temp"); @@ -128,27 +133,29 @@ protected Object doInBackground() throws Exception { getHaxmDownloadUrl(downloadUrls, haxmUrl, Platform.getName()); firePropertyChange(AndroidMode.getTextString("download_property.change_event_total"), 0, downloadUrls.totalSize); - // tools - File downloadedTools = new File(tempFolder, downloadUrls.toolsFilename); - downloadAndUnpack(downloadUrls.toolsUrl, downloadedTools, sdkFolder, true); - - // platform-tools + // Command-line tools + File downloadedCmdLineTools = new File(tempFolder, downloadUrls.cmdlineToolsFilename); + downloadAndUnpack(downloadUrls.cmdlineToolsUrl, downloadedCmdLineTools, sdkFolder, true); + File tmpFrom = new File(sdkFolder, "cmdline-tools"); + File tmpTo = new File(sdkFolder, "cmdline-tmp"); + AndroidUtil.moveDir(tmpFrom, tmpTo); + File cmdlineToolsFolder = new File(sdkFolder, "cmdline-tools/latest"); + if (!cmdlineToolsFolder.exists()) cmdlineToolsFolder.mkdirs(); + AndroidUtil.moveDir(tmpTo, cmdlineToolsFolder); + + // Platform tools File downloadedPlatformTools = new File(tempFolder, downloadUrls.platformToolsFilename); downloadAndUnpack(downloadUrls.platformToolsUrl, downloadedPlatformTools, sdkFolder, true); - // build-tools + // Build tools File downloadedBuildTools = new File(tempFolder, downloadUrls.buildToolsFilename); downloadAndUnpack(downloadUrls.buildToolsUrl, downloadedBuildTools, buildToolsFolder, true); - // platform + // Platform File downloadedPlatform = new File(tempFolder, downloadUrls.platformFilename); downloadAndUnpack(downloadUrls.platformUrl, downloadedPlatform, platformsFolder, false); - - // emulator, unpacks directly to sdk folder - File downloadedEmulator = new File(tempFolder, downloadUrls.emulatorFilename); - downloadAndUnpack(downloadUrls.emulatorUrl, downloadedEmulator, sdkFolder, true); - // usb driver + // USB driver if (Platform.isWindows()) { File downloadedFolder = new File(tempFolder, downloadUrls.usbDriverFilename); downloadAndUnpack(downloadUrls.usbDriverUrl, downloadedFolder, googleRepoFolder, false); @@ -160,6 +167,12 @@ protected Object doInBackground() throws Exception { downloadAndUnpack(downloadUrls.haxmUrl, downloadedFolder, haxmFolder, true); } + if (DOWNLOAD_EMU) { + // Emulator, unpacks directly to sdk folder + File downloadedEmulator = new File(tempFolder, downloadUrls.emulatorFilename); + downloadAndUnpack(downloadUrls.emulatorUrl, downloadedEmulator, sdkFolder, true); + } + if (Platform.isLinux() || Platform.isMacOS()) { Runtime.getRuntime().exec("chmod -R 755 " + sdkFolder.getAbsolutePath()); } @@ -246,7 +259,7 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, boolean found; // ----------------------------------------------------------------------- - // platform + // Platform expr = xpath.compile("//remotePackage[starts-with(@path, \"platforms;\")" + "and contains(@path, '" + AndroidBuild.TARGET_SDK + "')]"); // Skip latest platform; download only the targeted remotePackages = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); @@ -271,12 +284,12 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, throw new IOException(AndroidMode.getTextString("sdk_downloader.error_cannot_find_platform_files")); } - // Difference between platform tools, build tools, and SDK tools: + // Difference between platform tools, build tools, and SDK (now command-line) tools: // http://stackoverflow.com/questions/19911762/what-is-android-sdk-build-tools-and-which-version-should-be-used // Always get the latest! // ----------------------------------------------------------------------- - // platform-tools + // Platform tools expr = xpath.compile("//remotePackage[@path=\"platform-tools\"]"); remotePackages = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); if (remotePackages != null) { @@ -286,17 +299,17 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, } // ----------------------------------------------------------------------- - // build-tools + // Build tools expr = xpath.compile("//remotePackage[starts-with(@path, \"build-tools;\")]"); remotePackages = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); found = false; if (remotePackages != null) { - for(int buildTool=0; buildTool < remotePackages.getLength(); buildTool++) { + for (int buildTool = 0; buildTool < remotePackages.getLength(); buildTool++) { NodeList childNodes = remotePackages.item(buildTool).getChildNodes(); NodeList channel = ((Element) childNodes).getElementsByTagName("channelRef"); if(!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) - continue; //Stable channel only, skip others + continue; // Stable channel only, skip others NodeList revision = ((Element) childNodes).getElementsByTagName("revision"); String major = (((Element) revision.item(0)).getElementsByTagName("major")).item(0).getTextContent(); @@ -332,52 +345,21 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, } // ----------------------------------------------------------------------- - // tools - expr = xpath.compile("//remotePackage[@path=\"tools\"]"); // Matches two items according to xml file - remotePackages = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); - found = false; - if (remotePackages != null) { - NodeList childNodes = remotePackages.item(1).getChildNodes(); // Second item is the latest tools for now - NodeList archives = ((Element) childNodes).getElementsByTagName("archive"); - - for (int i = 0; i < archives.getLength(); ++i) { - NodeList archive = archives.item(i).getChildNodes(); - NodeList complete = ((Element) archive).getElementsByTagName("complete"); - - NodeList os = ((Element) archive).getElementsByTagName("host-os"); - NodeList url = ((Element) complete.item(0)).getElementsByTagName("url"); - NodeList size = ((Element) complete.item(0)).getElementsByTagName("size"); - - if (os.item(0).getTextContent().equals(requiredHostOs)) { - urlHolder.toolsFilename = url.item(0).getTextContent(); - urlHolder.toolsUrl = REPOSITORY_URL + urlHolder.toolsFilename; - urlHolder.totalSize += Integer.parseInt(size.item(0).getTextContent()); - found = true; - break; - } - } - } - if (!found) { - throw new IOException(AndroidMode.getTextString("sdk_downloader.error_cannot_find_tools")); - } - - // ----------------------------------------------------------------------- - // emulator - expr = xpath.compile("//remotePackage[@path=\"emulator\"]"); // Matches two items according to xml file + // Command-line tools + expr = xpath.compile("//remotePackage[starts-with(@path, \"cmdline-tools;\")]"); remotePackages = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); found = false; if (remotePackages != null) { - for(int i = 0; i < remotePackages.getLength(); ++i) { - NodeList childNodes = remotePackages.item(i).getChildNodes(); + for (int tool = 0; tool < remotePackages.getLength(); tool++) { + NodeList childNodes = remotePackages.item(tool).getChildNodes(); NodeList channel = ((Element) childNodes).getElementsByTagName("channelRef"); if(!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) - continue; //Stable channel only, skip others - + continue; // Stable channel only, skip others + NodeList archives = ((Element) childNodes).getElementsByTagName("archive"); - - for (int j = 0; j < archives.getLength(); ++j) { - NodeList archive = archives.item(j).getChildNodes(); + for (int i = 0; i < archives.getLength(); ++i) { + NodeList archive = archives.item(i).getChildNodes(); NodeList complete = ((Element) archive).getElementsByTagName("complete"); NodeList os = ((Element) archive).getElementsByTagName("host-os"); @@ -385,16 +367,56 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, NodeList size = ((Element) complete.item(0)).getElementsByTagName("size"); if (os.item(0).getTextContent().equals(requiredHostOs)) { - urlHolder.emulatorFilename = url.item(0).getTextContent(); - urlHolder.emulatorUrl = REPOSITORY_URL + urlHolder.emulatorFilename; + urlHolder.cmdlineToolsFilename = url.item(0).getTextContent(); + urlHolder.cmdlineToolsUrl = REPOSITORY_URL + urlHolder.cmdlineToolsFilename; urlHolder.totalSize += Integer.parseInt(size.item(0).getTextContent()); found = true; break; - } + } } - if (found) break; + if (found) break; } } + if (!found) { + throw new IOException(AndroidMode.getTextString("sdk_downloader.error_cannot_find_tools")); + } + + if (DOWNLOAD_EMU) { + // ----------------------------------------------------------------------- + // Emulator + expr = xpath.compile("//remotePackage[@path=\"emulator\"]"); + remotePackages = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); + found = false; + if (remotePackages != null) { + for (int i = 0; i < remotePackages.getLength(); ++i) { + NodeList childNodes = remotePackages.item(i).getChildNodes(); + + NodeList channel = ((Element) childNodes).getElementsByTagName("channelRef"); + if(!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) + continue; //Stable channel only, skip others + + NodeList archives = ((Element) childNodes).getElementsByTagName("archive"); + + for (int j = 0; j < archives.getLength(); ++j) { + NodeList archive = archives.item(j).getChildNodes(); + NodeList complete = ((Element) archive).getElementsByTagName("complete"); + + NodeList os = ((Element) archive).getElementsByTagName("host-os"); + NodeList url = ((Element) complete.item(0)).getElementsByTagName("url"); + NodeList size = ((Element) complete.item(0)).getElementsByTagName("size"); + + if (os.item(0).getTextContent().equals(requiredHostOs)) { + urlHolder.emulatorFilename = url.item(0).getTextContent(); + urlHolder.emulatorUrl = REPOSITORY_URL + urlHolder.emulatorFilename; + urlHolder.totalSize += Integer.parseInt(size.item(0).getTextContent()); + found = true; + break; + } + } + if (found) break; + } + } + } if (!found) { throw new IOException(AndroidMode.getTextString("sdk_downloader.error_cannot_find_emulator")); } @@ -456,7 +478,7 @@ private void getHaxmDownloadUrl(SDKUrlHolder urlHolder, expr = xpath.compile("//remotePackage[@path=\"extras;intel;Hardware_Accelerated_Execution_Manager\"]"); remotePackages = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); if (remotePackages != null) { - for (int i=0; i < remotePackages.getLength(); ++i) { + for (int i = 0; i < remotePackages.getLength(); ++i) { NodeList childNodes = remotePackages.item(i).getChildNodes(); NodeList archives = ((Element) childNodes).getElementsByTagName("archive"); diff --git a/mode/src/processing/mode/android/SysImageDownloader.java b/mode/src/processing/mode/android/SysImageDownloader.java index 1c4d1110f..3f380cca3 100644 --- a/mode/src/processing/mode/android/SysImageDownloader.java +++ b/mode/src/processing/mode/android/SysImageDownloader.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2016 The Processing Foundation + Copyright (c) 2016-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 diff --git a/mode/templates/ARActivity.java.tmpl b/mode/templates/ARActivity.java.tmpl index de59e2548..ade8e71a3 100644 --- a/mode/templates/ARActivity.java.tmpl +++ b/mode/templates/ARActivity.java.tmpl @@ -6,13 +6,14 @@ import android.net.Uri; import android.os.Bundle; import android.content.Intent; import android.provider.Settings; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; import android.view.ViewGroup; import android.widget.FrameLayout; -import android.support.v7.app.AppCompatActivity; import android.widget.Toast; +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + import processing.android.PFragment; import processing.android.CompatUtils; import processing.core.PApplet; diff --git a/mode/templates/ARBuild.gradle.tmpl b/mode/templates/ARBuild.gradle.tmpl index eb15201e5..6c887e2cd 100644 --- a/mode/templates/ARBuild.gradle.tmpl +++ b/mode/templates/ARBuild.gradle.tmpl @@ -30,13 +30,11 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'androidx.appcompat:appcompat:@@appcompat_version@@' implementation 'com.google.ar:core:@@gar_version@@' - implementation 'de.javagl:obj:0.2.1' - implementation 'com.android.support:appcompat-v7:@@support_version@@' - implementation 'com.android.support:design:@@support_version@@' implementation files('libs/processing-core.jar') - implementation files('libs/ar.jar') - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.1' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' + implementation files('libs/ar.jar') + androidTestImplementation 'com.android.support.test:runner:1.3.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13' } diff --git a/mode/templates/ARBuildECJ.gradle.tmpl b/mode/templates/ARBuildECJ.gradle.tmpl index f5bbce653..87b067f11 100644 --- a/mode/templates/ARBuildECJ.gradle.tmpl +++ b/mode/templates/ARBuildECJ.gradle.tmpl @@ -32,16 +32,16 @@ android { // https://github.com/bytedeco/javacpp/wiki/Gradle // https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html applicationVariants.all { variant -> - variant.javaCompile.doFirst { + variant.javaCompileProvider.get().doFirst { // The main class that runs the Eclipse batch compiler String ecjMain = 'org.eclipse.jdt.internal.compiler.batch.Main' // We construct the list of arguments needed by the batch compiler // https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm List ecjArgs = ['-nowarn', - '-source', variant.javaCompile.sourceCompatibility, - '-target', variant.javaCompile.targetCompatibility, - '-d', variant.javaCompile.destinationDir] as String[] + '-source', variant.javaCompileProvider.get().sourceCompatibility, + '-target', variant.javaCompileProvider.get().targetCompatibility, + '-d', variant.javaCompileProvider.get().destinationDir] as String[] // Set the debug attributes level according to the build target if (variant.name == 'debug') { @@ -53,11 +53,11 @@ android { } // Adding all the source files to the list of arguments - ecjArgs += variant.javaCompile.source + ecjArgs += variant.javaCompileProvider.get().source // Add the Android jar to the classpath inherited from the task FileCollection ecjClasspath = files('@@target_platform@@/android.jar', - variant.javaCompile.classpath) + variant.javaCompileProvider.get().classpath) // Running the JavaExec task, which requires the main class to run, // the classpath, and the list of arguments @@ -78,9 +78,7 @@ android { dependencies { compileOnly files('@@tools_folder@@/../modes/java/mode/org.eclipse.jdt.core.jar') implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:@@support_version@@' - implementation 'com.android.support:design:@@support_version@@' - implementation 'com.google.android.support:wearable:@@wear_version@@' + implementation 'androidx.appcompat:appcompat:@@appcompat_version@@' implementation 'com.google.ar:core:@@gar_version@@' implementation files('libs/processing-core.jar') implementation files('libs/ar.jar') diff --git a/mode/templates/AppActivity.java.tmpl b/mode/templates/AppActivity.java.tmpl index c89390485..3e24984b4 100644 --- a/mode/templates/AppActivity.java.tmpl +++ b/mode/templates/AppActivity.java.tmpl @@ -4,7 +4,7 @@ import android.os.Bundle; import android.content.Intent; import android.view.ViewGroup; import android.widget.FrameLayout; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import processing.android.PFragment; import processing.android.CompatUtils; diff --git a/mode/templates/AppBuild.gradle.tmpl b/mode/templates/AppBuild.gradle.tmpl index ddd6096cc..10111794c 100644 --- a/mode/templates/AppBuild.gradle.tmpl +++ b/mode/templates/AppBuild.gradle.tmpl @@ -35,12 +35,10 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support:appcompat-v7:@@support_version@@' - implementation 'com.android.support:design:@@support_version@@' - implementation 'com.google.android.support:wearable:@@wear_version@@' - compileOnly 'com.google.android.wearable:wearable:@@wear_version@@' + implementation 'androidx.appcompat:appcompat:@@appcompat_version@@' implementation files('libs/processing-core.jar') - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.1' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' + androidTestImplementation 'com.android.support.test:runner:1.3.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13' } + diff --git a/mode/templates/AppBuildECJ.gradle.tmpl b/mode/templates/AppBuildECJ.gradle.tmpl index 6c33e21a0..39476875a 100644 --- a/mode/templates/AppBuildECJ.gradle.tmpl +++ b/mode/templates/AppBuildECJ.gradle.tmpl @@ -38,16 +38,16 @@ android { // https://github.com/bytedeco/javacpp/wiki/Gradle // https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html applicationVariants.all { variant -> - variant.javaCompile.doFirst { + variant.javaCompileProvider.get().doFirst { // The main class that runs the Eclipse batch compiler String ecjMain = 'org.eclipse.jdt.internal.compiler.batch.Main' // We construct the list of arguments needed by the batch compiler // https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm List ecjArgs = ['-nowarn', - '-source', variant.javaCompile.sourceCompatibility, - '-target', variant.javaCompile.targetCompatibility, - '-d', variant.javaCompile.destinationDir] as String[] + '-source', variant.javaCompileProvider.get().sourceCompatibility, + '-target', variant.javaCompileProvider.get().targetCompatibility, + '-d', variant.javaCompileProvider.get().destinationDir] as String[] // Set the debug attributes level according to the build target if (variant.name == 'debug') { @@ -59,15 +59,15 @@ android { } // Adding all the source files to the list of arguments - ecjArgs += variant.javaCompile.source + ecjArgs += variant.javaCompileProvider.get().source // Add the Android jar to the classpath inherited from the task FileCollection ecjClasspath = files('@@target_platform@@/android.jar', - variant.javaCompile.classpath) + variant.javaCompileProvider.get().classpath) // Running the JavaExec task, which requires the main class to run, // the classpath, and the list of arguments - // https://docs.gradle.org/4.4/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:main + // https://docs.gradle.org/4.4/dsl/org.gradle.api.tasks.JavaExec.html#org.gradle.api.tasks.JavaExec:main javaexec { main ecjMain classpath ecjClasspath @@ -84,9 +84,6 @@ android { dependencies { compileOnly files('@@tools_folder@@/../modes/java/mode/org.eclipse.jdt.core.jar') implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:@@support_version@@' - implementation 'com.android.support:design:@@support_version@@' - implementation 'com.google.android.support:wearable:@@wear_version@@' - compileOnly 'com.google.android.wearable:wearable:@@wear_version@@' + implementation 'androidx.appcompat:appcompat:@@appcompat_version@@' implementation files('libs/processing-core.jar') } diff --git a/mode/templates/Properties.gradle.tmpl b/mode/templates/Properties.gradle.tmpl new file mode 100644 index 000000000..777b6aad8 --- /dev/null +++ b/mode/templates/Properties.gradle.tmpl @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536m +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/mode/templates/Properties.local.tmpl b/mode/templates/Properties.local.tmpl new file mode 100644 index 000000000..ee51efb73 --- /dev/null +++ b/mode/templates/Properties.local.tmpl @@ -0,0 +1 @@ +sdk.dir=@@sdk_path@@ \ No newline at end of file diff --git a/mode/templates/TopBuild.gradle.tmpl b/mode/templates/TopBuild.gradle.tmpl index fbdb9f106..7b9e18146 100644 --- a/mode/templates/TopBuild.gradle.tmpl +++ b/mode/templates/TopBuild.gradle.tmpl @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:@@gradle_version@@' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,6 +16,8 @@ buildscript { allprojects { repositories { + maven { url "https://maven.google.com" } + maven { url "https://jitpack.io" } google() jcenter() } diff --git a/mode/templates/VRBuild.gradle.tmpl b/mode/templates/VRBuild.gradle.tmpl index db55f0dbb..dda8d5c97 100644 --- a/mode/templates/VRBuild.gradle.tmpl +++ b/mode/templates/VRBuild.gradle.tmpl @@ -33,15 +33,12 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support:appcompat-v7:@@support_version@@' - implementation 'com.android.support:design:@@support_version@@' - implementation 'com.google.android.support:wearable:@@wear_version@@' - compileOnly 'com.google.android.wearable:wearable:@@wear_version@@' + implementation 'androidx.appcompat:appcompat:@@appcompat_version@@' implementation 'com.google.vr:sdk-audio:@@gvr_version@@' - implementation 'com.google.vr:sdk-base:@@gvr_version@@' + implementation 'com.google.vr:sdk-base:@@gvr_version@@' implementation files('libs/processing-core.jar') - implementation files('libs/vr.jar') - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.1' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' + implementation files('libs/vr.jar') + androidTestImplementation 'com.android.support.test:runner:1.3.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13' } diff --git a/mode/templates/VRBuildECJ.gradle.tmpl b/mode/templates/VRBuildECJ.gradle.tmpl index 48f91397b..d51dd5ba2 100644 --- a/mode/templates/VRBuildECJ.gradle.tmpl +++ b/mode/templates/VRBuildECJ.gradle.tmpl @@ -36,16 +36,16 @@ android { // https://github.com/bytedeco/javacpp/wiki/Gradle // https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html applicationVariants.all { variant -> - variant.javaCompile.doFirst { + variant.javaCompileProvider.get().doFirst { // The main class that runs the Eclipse batch compiler String ecjMain = 'org.eclipse.jdt.internal.compiler.batch.Main' // We construct the list of arguments needed by the batch compiler // https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm List ecjArgs = ['-nowarn', - '-source', variant.javaCompile.sourceCompatibility, - '-target', variant.javaCompile.targetCompatibility, - '-d', variant.javaCompile.destinationDir] as String[] + '-source', variant.javaCompileProvider.get().sourceCompatibility, + '-target', variant.javaCompileProvider.get().targetCompatibility, + '-d', variant.javaCompileProvider.get().destinationDir] as String[] // Set the debug attributes level according to the build target if (variant.name == 'debug') { @@ -57,11 +57,11 @@ android { } // Adding all the source files to the list of arguments - ecjArgs += variant.javaCompile.source + ecjArgs += variant.javaCompileProvider.get().source // Add the Android jar to the classpath inherited from the task FileCollection ecjClasspath = files('@@target_platform@@/android.jar', - variant.javaCompile.classpath) + variant.javaCompileProvider.get().classpath) // Running the JavaExec task, which requires the main class to run, // the classpath, and the list of arguments @@ -82,10 +82,7 @@ android { dependencies { compileOnly files('@@tools_folder@@/../modes/java/mode/org.eclipse.jdt.core.jar') implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:@@support_version@@' - implementation 'com.android.support:design:@@support_version@@' - implementation 'com.google.android.support:wearable:@@wear_version@@' - compileOnly 'com.google.android.wearable:wearable:@@wear_version@@' + implementation 'androidx.appcompat:appcompat:@@appcompat_version@@' implementation 'com.google.vr:sdk-audio:@@gvr_version@@' implementation 'com.google.vr:sdk-base:@@gvr_version@@' implementation files('libs/processing-core.jar') diff --git a/mode/templates/WearBuild.gradle.tmpl b/mode/templates/WearBuild.gradle.tmpl index f77ec39a9..ad6f914fa 100644 --- a/mode/templates/WearBuild.gradle.tmpl +++ b/mode/templates/WearBuild.gradle.tmpl @@ -33,12 +33,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:palette-v7:@@support_version@@' - implementation 'com.android.support:support-v4:@@support_version@@' implementation 'com.google.android.gms:play-services-wearable:@@play_services_version@@' - implementation 'com.android.support:percent:@@support_version@@' - implementation 'com.android.support:recyclerview-v7:@@support_version@@' implementation 'com.google.android.support:wearable:@@wear_version@@' - compileOnly 'com.google.android.wearable:wearable:@@wear_version@@' + compileOnly 'com.google.android.wearable:wearable:@@wear_version@@' implementation files('libs/processing-core.jar') } diff --git a/mode/templates/WearBuildECJ.gradle.tmpl b/mode/templates/WearBuildECJ.gradle.tmpl index 8a94cc4c1..291c90a90 100644 --- a/mode/templates/WearBuildECJ.gradle.tmpl +++ b/mode/templates/WearBuildECJ.gradle.tmpl @@ -36,16 +36,16 @@ android { // https://github.com/bytedeco/javacpp/wiki/Gradle // https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html applicationVariants.all { variant -> - variant.javaCompile.doFirst { + variant.javaCompileProvider.get().doFirst { // The main class that runs the Eclipse batch compiler String ecjMain = 'org.eclipse.jdt.internal.compiler.batch.Main' // We construct the list of arguments needed by the batch compiler // https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-using_batch_compiler.htm List ecjArgs = ['-nowarn', - '-source', variant.javaCompile.sourceCompatibility, - '-target', variant.javaCompile.targetCompatibility, - '-d', variant.javaCompile.destinationDir] as String[] + '-source', variant.javaCompileProvider.get().sourceCompatibility, + '-target', variant.javaCompileProvider.get().targetCompatibility, + '-d', variant.javaCompileProvider.get().destinationDir] as String[] // Set the debug attributes level according to the build target if (variant.name == 'debug') { @@ -57,11 +57,11 @@ android { } // Adding all the source files to the list of arguments - ecjArgs += variant.javaCompile.source + ecjArgs += variant.javaCompileProvider.get().source // Add the Android jar to the classpath inherited from the task FileCollection ecjClasspath = files('@@target_platform@@/android.jar', - variant.javaCompile.classpath) + variant.javaCompileProvider.get().classpath) // Running the JavaExec task, which requires the main class to run, // the classpath, and the list of arguments @@ -82,13 +82,9 @@ android { dependencies { compileOnly files('@@tools_folder@@/../modes/java/mode/org.eclipse.jdt.core.jar') implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:palette-v7:@@support_version@@' - implementation 'com.android.support:support-v4:@@support_version@@' implementation 'com.google.android.gms:play-services-wearable:@@play_services_version@@' - implementation 'com.android.support:percent:@@support_version@@' - implementation 'com.android.support:recyclerview-v7:@@support_version@@' implementation 'com.google.android.support:wearable:@@wear_version@@' - compileOnly 'com.google.android.wearable:wearable:@@wear_version@@' + compileOnly 'com.google.android.wearable:wearable:@@wear_version@@' implementation files('libs/processing-core.jar') } diff --git a/mode/tools/SDKUpdater/.classpath b/mode/tools/SDKUpdater/.classpath index baec41f58..d1600092a 100644 --- a/mode/tools/SDKUpdater/.classpath +++ b/mode/tools/SDKUpdater/.classpath @@ -3,8 +3,8 @@ - - + + diff --git a/mode/tools/SDKUpdater/build.gradle b/mode/tools/SDKUpdater/build.gradle index f9b26d43f..edf55981e 100644 --- a/mode/tools/SDKUpdater/build.gradle +++ b/mode/tools/SDKUpdater/build.gradle @@ -1,12 +1,36 @@ import java.nio.file.Files import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; +configurations { + implementation.extendsFrom implementationCopy +} + dependencies { - compile group: "org.processing", name: "pde", version: "${processingVersion}" + // implementation group: "org.processing", name: "pde", version: "${processingVersion}" + implementation group: "org.processing", name: "java-mode", version: "${processingVersion}" + implementation fileTree(include: ["AndroidMode.jar"], dir: '../../mode') + + implementationCopy group: "com.android.tools", name: "sdklib", version: "${toolsLibVersion}" + implementationCopy group: "com.android.tools", name: "repository", version: "${toolsLibVersion}" +} - compile name: "sdklib-${toolsLibVersion}" - compile name: "repository-${toolsLibVersion}" +// This task copies the gradle tooling jar into the mode folder +task copyToLib(type: Copy) { + from configurations.implementationCopy.files { + include '**/annotations-*' + include '**/common-*' + include '**/dvlib-*' + include '**/gson-*' + include '**/guava-*' + include '**/httpcore-*' + include '**/kotlin-stdlib-*' + include '**/layoutlib-api-*' + include '**/repository-*' + include '**/sdklib-*' + } + into "lib" } +build.dependsOn(copyToLib) sourceSets { main { @@ -18,6 +42,7 @@ sourceSets { clean.doFirst { delete "tool" + delete "lib" } build.doLast { diff --git a/mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java b/mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java index 3165663e4..0344eb57c 100644 --- a/mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java +++ b/mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java @@ -68,8 +68,13 @@ public class SDKUpdater extends JFrame implements PropertyChangeListener, Tool { final static private int BUTTON_WIDTH = Toolkit.zoom(75); final static private int BUTTON_HEIGHT = Toolkit.zoom(25); +// private final Vector columns = new Vector<>(Arrays.asList( +// AndroidMode.getTextString("sdk_updater.name_column"), +// AndroidMode.getTextString("sdk_updater.version_column"), +// AndroidMode.getTextString("sdk_updater.available_column"))); private final Vector columns = new Vector<>(Arrays.asList( - "Package name", "Installed version", "Available update")); + "Package name", "Installed version", "Available update" )); + private static final String PROPERTY_CHANGE_QUERY = "query"; private File sdkFolder; @@ -102,13 +107,15 @@ public void run() { queryTask = new QueryTask(); queryTask.addPropertyChangeListener(this); queryTask.execute(); +// status.setText(AndroidMode.getTextString("sdk_updater.query_message")); status.setText("Querying packages..."); } - + @Override - public String getMenuTitle() { - return "menu.android.sdk_updater"; + public String getMenuTitle() { +// return AndroidMode.getTextString("menu.android.sdk_updater"); + return "SDK Updater"; } @@ -119,13 +126,16 @@ public void propertyChange(PropertyChangeEvent evt) { progressBar.setIndeterminate(false); if (numUpdates == 0) { actionButton.setEnabled(false); - status.setText("No updates available"); +// status.setText(AndroidMode.getTextString("sdk_updater.no_updates_message")); + status.setText("No updates available"); } else { actionButton.setEnabled(true); if (numUpdates == 1) { +// status.setText(AndroidMode.getTextString("sdk_updater.one_updates_message")); status.setText("1 update found!"); } else { - status.setText(numUpdates + " updates found!"); +// status.setText(AndroidMode.getTextString("sdk_updater.many_updates_message", numUpdates)); + status.setText(numUpdates + " updates found!"); } } break; @@ -165,6 +175,15 @@ public void setForceHttp(boolean b) { } public Channel getChannel() { return null; } + + @Override + public boolean getDisableSdkPatches() { + return false; + } + + @Override + public void setDisableSdkPatches(boolean arg0) { + } }), null); RepositoryPackages packages = mRepoManager.getPackages(); @@ -266,6 +285,7 @@ protected Object doInBackground() throws Exception { for (String path : settings.getPaths(mRepoManager)) { RemotePackage p = mRepoManager.getPackages().getRemotePackages().get(path); if (p == null) { +// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_finding_package", path)); progress.logWarning("Failed to find package " + path); throw new SdkManagerCli.CommandFailedException(); } @@ -283,6 +303,7 @@ protected Object doInBackground() throws Exception { } } } else { +// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_computing_dependency_list")); progress.logWarning("Unable to compute a complete list of dependencies."); throw new SdkManagerCli.CommandFailedException(); } @@ -297,6 +318,7 @@ protected void done() { try { get(); actionButton.setEnabled(false); +// status.setText(AndroidMode.getTextString("sdk_updater.refresh_package_message")); status.setText("Refreshing packages..."); queryTask = new QueryTask(); queryTask.addPropertyChangeListener(SDKUpdater.this); @@ -340,6 +362,17 @@ public java.util.List getPaths(RepoManager mgr) { } return updates; } + + @Override + public boolean getDisableSdkPatches() { + return false; + } + + @Override + public void setDisableSdkPatches(boolean arg0) { + // TODO Auto-generated method stub + + } } } @@ -435,7 +468,9 @@ public void actionPerformed(ActionEvent e) { // }; // update.start(); +// status.setText(AndroidMode.getTextString("sdk_updater.download_package_message")); status.setText("Downloading available updates..."); +// actionButton.setText(AndroidMode.getTextString("sdk_updater.cancel_button_label")); actionButton.setText("Cancel"); } } @@ -459,6 +494,7 @@ public void actionPerformed(ActionEvent actionEvent) { } }; +// JButton closeButton = new JButton(AndroidMode.getTextString("sdk_updater.close_button_label")); JButton closeButton = new JButton("Close"); closeButton.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT)); closeButton.addActionListener(disposer); @@ -498,10 +534,14 @@ public void cancelTasks() { queryTask.cancel(true); if (downloadTaskRunning) { downloadTask.cancel(true); +// status.setText(AndroidMode.getTextString("sdk_updater.download_canceled_message")); status.setText("Download canceled"); JOptionPane.showMessageDialog(null, - "Download canceled", "Warning", JOptionPane.WARNING_MESSAGE); - actionButton.setText("Update"); +// AndroidMode.getTextString("sdk_updater.download_canceled_message"), + "Download canceled", + "Warning", JOptionPane.WARNING_MESSAGE); +// actionButton.setText(AndroidMode.getTextString("sdk_updater.update_button_label")); + actionButton.setText("Update"); } } diff --git a/mode/version.properties b/mode/version.properties index ada822060..aaade7115 100644 --- a/mode/version.properties +++ b/mode/version.properties @@ -1,7 +1,8 @@ # Basics -android-platform = 28 -android-toolslib = 26.0.0-dev -gradlew = 5.6.2 +android-platform = 29 +android-toolslib = 27.1.1 +gradlew = 6.7.1 +gradle = 4.1.1 # Minimum SDK versions for each type of project android-min-app = 17 @@ -12,12 +13,13 @@ android-min-wear = 25 # Dependencies. Latest version for each package can be found at https://mvnrepository.com # The format below is group%artifact -com.android.support%support-v4 = 28.0.0 -com.google.android.support%wearable = 2.4.0 -com.google.android.gms%play-services-wearable = 16.0.1 +androidx.appcompat%appcompat = 1.2.0 +androidx.legacy%legacy-support-v4 = 1.0.0 +com.google.android.support%wearable = 2.8.1 +com.google.android.gms%play-services-wearable = 17.0.0 com.google.vr = 1.180.0 -com.google.ar = 1.12.0 +com.google.ar = 1.22.0 org.processing = 3.3.7 -org.gradle%gradle-tooling-api = 5.6.2 -org.slf4j = 1.7.28 +org.gradle%gradle-tooling-api = 6.7.1 +org.slf4j = 1.7.30 org.eclipse.jdt = 3.11.100 \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 8090e1beb..06af19208 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ -include ':core', ':mode:libraries:vr', ':mode:libraries:ar', 'mode:tools:SDKUpdater', ':mode' +include ':core', ':mode', ':mode:libraries:vr', ':mode:libraries:ar', 'mode:tools:SDKUpdater'