Skip to content

Commit f273a7e

Browse files
authored
Merge pull request #616 from rupesh-kumar-lpu/master
Core AndroidX support and creation of distributions for JCentre
2 parents 29d5fe2 + 6129aa8 commit f273a7e

File tree

136 files changed

+96507
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+96507
-99
lines changed

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ allprojects {
2626
versions.load(project.rootProject.file("mode/version.properties").newDataInputStream())
2727
ext.targetSdkVersion = versions.getProperty("android-platform")
2828
ext.supportLibsVersion = versions.getProperty("com.android.support%support-v4")
29+
ext.supportLibsVersionAndroidX=versions.getProperty("androidx.appcompat%appcompat")
2930
ext.wearVersion = versions.getProperty("com.google.android.support%wearable")
3031
ext.gvrVersion = versions.getProperty("com.google.vr")
3132
ext.garVersion = versions.getProperty("com.google.ar")
@@ -39,6 +40,7 @@ allprojects {
3940
Properties modeProperties = new Properties()
4041
modeProperties.load(project.rootProject.file("mode/mode.properties").newDataInputStream())
4142
ext.modeVersion = modeProperties.getProperty("prettyVersion")
43+
ext.modeVersionAndroidX = modeProperties.getProperty("prettyVersionAndroidX")
4244

4345
Properties vrProperties = new Properties()
4446
vrProperties.load(project.rootProject.file("mode/libraries/vr/library.properties").newDataInputStream())
@@ -49,6 +51,7 @@ allprojects {
4951
ext.arLibVersion = arProperties.getProperty("prettyVersion")
5052

5153

54+
5255
def fn = project.rootProject.file("local.properties")
5356
if (!fn.exists()) {
5457
if (System.env["ANDROID_SDK"] != null) {

core-androidx/build.gradle

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import java.nio.file.Files
2+
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
3+
4+
apply plugin: 'maven'
5+
apply plugin: 'aar'
6+
7+
dependencies {
8+
implementation name: "android"
9+
10+
implementationAar "androidx.appcompat:appcompat:${supportLibsVersionAndroidX}"
11+
implementationAar "com.google.android.support:wearable:${wearVersion}"
12+
}
13+
14+
task createPom {
15+
pom {
16+
project {
17+
groupId "org.p5android"
18+
artifactId "processing-core-androidx"
19+
version "${modeVersionAndroidX}"
20+
packaging "jar"
21+
licenses {
22+
license {
23+
name "GNU Lesser General Public License, version 2.1"
24+
url "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt"
25+
distribution "repo"
26+
}
27+
}
28+
dependencies {
29+
dependency {
30+
groupId "androidx.appcompat"
31+
artifactId "appcompat"
32+
version "${supportLibsVersionAndroidX}"
33+
scope "implementation"
34+
}
35+
dependency {
36+
groupId "com.google.android.support"
37+
artifactId "wearable"
38+
version "${wearVersion}"
39+
scope "implementation"
40+
}
41+
}
42+
}
43+
}.writeTo("dist/processing-core-androidx-${modeVersionAndroidX}.pom")
44+
}
45+
46+
sourceSets {
47+
main {
48+
java {
49+
srcDirs = ["src/"]
50+
}
51+
resources {
52+
srcDirs = ["src/"]
53+
}
54+
}
55+
}
56+
57+
task sourcesJar(type: Jar, dependsOn: classes) {
58+
classifier = "sources"
59+
from sourceSets.main.allSource
60+
}
61+
62+
// Does not work because of Processing-specific tags in source code, such as @webref
63+
task javadocJar(type: Jar, dependsOn: javadoc) {
64+
classifier = "javadoc"
65+
from javadoc.destinationDir
66+
}
67+
68+
artifacts {
69+
// archives javadocJar
70+
archives sourcesJar
71+
}
72+
73+
jar.doLast { task ->
74+
ant.checksum file: task.archivePath
75+
}
76+
77+
clean.doFirst {
78+
delete "dist"
79+
//delete "${coreZipPath}" // TODO - Currently no need to delete.
80+
// We have not implemented androidx in android mode.
81+
// Need to declare new variable in root build.gradle for androidx to use in Android Mode for PDE
82+
}
83+
84+
/*
85+
// No need to copy these are already there in the mode by core compile.
86+
// By following task androidx-support jar can be added as ${rootDir}/mode/mode/ by copying from ${rootDir}/build/libs/
87+
compileJava.doFirst {
88+
String[] deps = ["percent.jar",
89+
"recyclerview-v7.jar",
90+
"support-compat.jar",
91+
"support-core-ui.jar",
92+
"support-core-utils.jar",
93+
"support-fragment.jar",
94+
"support-media-compat.jar",
95+
"support-v4.jar",
96+
"wearable.jar"]
97+
for (String fn : deps) {
98+
Files.copy(file("${rootDir}/build/libs/" + fn).toPath(),
99+
file("${rootDir}/mode/mode/" + fn).toPath(), REPLACE_EXISTING)
100+
}
101+
}
102+
*/
103+
104+
build.doLast {
105+
// TODO - Not adding core-androidx in android mode for now.
106+
//Files.copy(file("${buildDir}/libs/core.jar").toPath(),
107+
// file("${coreZipPath}").toPath(), REPLACE_EXISTING)
108+
109+
// Copying the files for release on JCentral
110+
File distFolder = file("dist")
111+
distFolder.mkdirs()
112+
Files.copy(file("${buildDir}/libs/core-androidx.jar").toPath(),
113+
file("dist/processing-core-androidx-${modeVersionAndroidX}.jar").toPath(), REPLACE_EXISTING)
114+
Files.copy(file("${buildDir}/libs/core-androidx-sources.jar").toPath(),
115+
file("dist/processing-core-androidx-${modeVersionAndroidX}-sources.jar").toPath(), REPLACE_EXISTING)
116+
Files.copy(file("${buildDir}/libs/core-androidx.jar.MD5").toPath(),
117+
file("dist/processing-core-androidx-${modeVersionAndroidX}.jar.md5").toPath(), REPLACE_EXISTING)
118+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
Part of the Processing project - http://processing.org
3+
4+
Copyright (c) 2012-16 The Processing Foundation
5+
Copyright (c) 2004-12 Ben Fry and Casey Reas
6+
Copyright (c) 2001-04 Massachusetts Institute of Technology
7+
8+
This library is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU Lesser General Public
10+
License as published by the Free Software Foundation, version 2.1.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General
18+
Public License along with this library; if not, write to the
19+
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20+
Boston, MA 02111-1307 USA
21+
*/
22+
23+
#ifdef GL_ES
24+
precision mediump float;
25+
precision mediump int;
26+
#endif
27+
28+
varying vec4 vertColor;
29+
30+
void main() {
31+
gl_FragColor = vertColor;
32+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
Part of the Processing project - http://processing.org
3+
4+
Copyright (c) 2012-16 The Processing Foundation
5+
Copyright (c) 2004-12 Ben Fry and Casey Reas
6+
Copyright (c) 2001-04 Massachusetts Institute of Technology
7+
8+
This library is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU Lesser General Public
10+
License as published by the Free Software Foundation, version 2.1.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General
18+
Public License along with this library; if not, write to the
19+
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20+
Boston, MA 02111-1307 USA
21+
*/
22+
23+
uniform mat4 transformMatrix;
24+
25+
attribute vec4 position;
26+
attribute vec4 color;
27+
28+
varying vec4 vertColor;
29+
30+
void main() {
31+
gl_Position = transformMatrix * position;
32+
33+
vertColor = color;
34+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
Part of the Processing project - http://processing.org
3+
4+
Copyright (c) 2012-16 The Processing Foundation
5+
Copyright (c) 2004-12 Ben Fry and Casey Reas
6+
Copyright (c) 2001-04 Massachusetts Institute of Technology
7+
8+
This library is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU Lesser General Public
10+
License as published by the Free Software Foundation, version 2.1.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General
18+
Public License along with this library; if not, write to the
19+
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20+
Boston, MA 02111-1307 USA
21+
*/
22+
23+
#ifdef GL_ES
24+
precision mediump float;
25+
precision mediump int;
26+
#endif
27+
28+
varying vec4 vertColor;
29+
varying vec4 backVertColor;
30+
31+
void main() {
32+
gl_FragColor = gl_FrontFacing ? vertColor : backVertColor;
33+
}

0 commit comments

Comments
 (0)