Skip to content

Migration to AndroidX #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
85fe852
Migrated to androidx, Android R preview
pineapplegreentea Apr 30, 2020
8de9a4c
Added core-androidx source assets
rupeshkumar22 Dec 24, 2020
b48a88f
Added source processing inside core-androidx
rupeshkumar22 Dec 24, 2020
4fcfe79
Create build.gradle
rupeshkumar22 Dec 24, 2020
0f6854f
Update build.gradle with androidx version vars
rupeshkumar22 Dec 24, 2020
1b6234a
Update versions for AndroidX
rupeshkumar22 Dec 24, 2020
712c414
Update mode version for androidX
rupeshkumar22 Dec 24, 2020
12eaa05
Included core-androidx
rupeshkumar22 Dec 24, 2020
09a9a25
Merge pull request #619 from pineapplegreentea/master
codeanticode Dec 30, 2020
a2bfcd1
updating dependencies to AndroidX
codeanticode Dec 30, 2020
ad05690
Merge pull request #1 from processing/androidx
rupeshkumar22 Dec 31, 2020
157d6aa
Revert "Updating forked androidx branch"
rupeshkumar22 Dec 31, 2020
86226ef
Merge pull request #2 from rupesh-kumar-lpu/revert-1-androidx
rupeshkumar22 Dec 31, 2020
328d7b7
new templates
codeanticode Dec 31, 2020
a854539
generate gradle properties from template
codeanticode Dec 31, 2020
844ce0e
updated repo to get latest versions of gradle tooling
codeanticode Jan 1, 2021
29d5fe2
updated gradle wrapper
codeanticode Jan 1, 2021
6129aa8
Merge branch 'androidx' into master
codeanticode Jan 1, 2021
f273a7e
Merge pull request #616 from rupesh-kumar-lpu/master
codeanticode Jan 1, 2021
71bdb3f
Revert "Core AndroidX support and creation of distributions for JCent…
codeanticode Jan 1, 2021
763e3e5
Merge pull request #620 from processing/revert-616-master
codeanticode Jan 1, 2021
7e86fcf
update to compile/target sdk version 29
codeanticode Jan 1, 2021
da522a4
pull sdk updated deps from maven
codeanticode Jan 2, 2021
9c23f46
fix/update ingnore list
codeanticode Jan 2, 2021
f37a574
update deps & headers
codeanticode Jan 2, 2021
1043bc9
fix error when donwloading tools
codeanticode Jan 2, 2021
88d6053
use command-line tools naming
codeanticode Jan 2, 2021
7e7f372
download cmdline tools package
codeanticode Jan 2, 2021
df48e40
flush not needed, causes an IOException
codeanticode Jan 2, 2021
5cc0c57
Include all required deps by updated and lang support
codeanticode Jan 2, 2021
ea93b61
remove use of compile configuration
codeanticode Jan 2, 2021
25bb629
don't use language strings for the mode tools for the time being
codeanticode Jan 2, 2021
45fb3b6
populate mode tools according to found valid subfolders
codeanticode Jan 2, 2021
79a75b0
removed autgen comment
codeanticode Jan 2, 2021
a1f8edb
udpate deps in build and template files
codeanticode Jan 3, 2021
bfe4ec7
fixed sketch templates and build classpath
codeanticode Jan 3, 2021
de89d88
added java cross-compilation option to build file
codeanticode Jan 3, 2021
ff98245
set correct target platform var
codeanticode Jan 3, 2021
0c980d0
added gradle version to properties
codeanticode Jan 3, 2021
2ef2393
emulator download can be disabled
codeanticode Jan 3, 2021
4dfb730
tweaked init logic to support new SDK behavior
codeanticode Jan 3, 2021
e350bec
removed editor option to accept licenses
codeanticode Jan 3, 2021
674f766
made accet licenses method private again
codeanticode Jan 3, 2021
2018d85
replace javaCompile with javaCompileProvider in build templates
codeanticode Jan 3, 2021
4545829
updated year ranges in mode's source
codeanticode Jan 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 21 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand All @@ -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")
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
20 changes: 6 additions & 14 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -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}"
}

Expand All @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
30 changes: 14 additions & 16 deletions core/src/processing/a2d/PGraphicsAndroid2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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
Expand Down
23 changes: 23 additions & 0 deletions core/src/processing/a2d/PShapeAndroid2D.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions core/src/processing/a2d/PSurfaceAndroid2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,14 +23,14 @@
package processing.a2d;

import android.content.Context;

import android.graphics.Color;
import android.graphics.PixelFormat;
import android.service.wallpaper.WallpaperService;
import android.support.wearable.watchface.CanvasWatchFaceService;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

import processing.android.AppComponent;
import processing.android.PFragment;
import processing.core.PApplet;
Expand Down
2 changes: 1 addition & 1 deletion core/src/processing/android/ActivityAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion core/src/processing/android/AppComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,6 +23,7 @@
package processing.android;

import android.content.Intent;

import processing.core.PApplet;
import processing.core.PConstants;

Expand Down
9 changes: 5 additions & 4 deletions core/src/processing/android/CompatUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,16 +22,17 @@

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;
import android.view.Display;
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
Expand Down
16 changes: 9 additions & 7 deletions core/src/processing/android/PFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions core/src/processing/android/PWallpaper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion core/src/processing/android/PWatchFaceCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -38,6 +38,7 @@
import android.view.SurfaceHolder;
import android.view.WindowInsets;
import android.view.WindowManager;

import processing.a2d.PGraphicsAndroid2D;
import processing.core.PApplet;

Expand Down
Loading