diff --git a/.gitignore b/.gitignore index 17a48cf..73de866 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ -.gradle -/local.properties -/.idea +.gradle/ +local.properties +.idea/ *.iml .DS_Store -/build +build/ .watchmanconfig diff --git a/build.gradle b/build.gradle index 5363b83..34c7294 100644 --- a/build.gradle +++ b/build.gradle @@ -1,16 +1,20 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { + google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.1' + classpath 'com.android.tools.build:gradle:3.6.1' } } allprojects { repositories { + google() jcenter() } } + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 793004c..5c2d1cf 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 c0ea07c..0ebb310 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Apr 11 17:45:27 SGT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip diff --git a/gradlew b/gradlew index 4453cce..83f2acf 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,16 +44,16 @@ 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" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -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"` @@ -155,7 +171,7 @@ if $cygwin ; then fi # Escape application args -save ( ) { +save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } diff --git a/gradlew.bat b/gradlew.bat index e95643d..24467a1 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/release.gradle b/release.gradle index 9be33a0..de24fcc 100644 --- a/release.gradle +++ b/release.gradle @@ -35,8 +35,8 @@ afterEvaluate { project -> android.libraryVariants.all { variant -> def name = variant.name.capitalize() - task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) { - from variant.javaCompile.destinationDir + task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider.get()) { + from variant.javaCompileProvider.get().destinationDir } } @@ -65,7 +65,6 @@ afterEvaluate { project -> authentication( userName: getMavenRepositoryUsername(), password: getMavenRepositoryPassword()) - } pom.project { diff --git a/yearclass-sample/.gitignore b/yearclass-sample/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/yearclass-sample/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/yearclass-sample/build.gradle b/yearclass-sample/build.gradle index 78cafbe..c8bdcfc 100644 --- a/yearclass-sample/build.gradle +++ b/yearclass-sample/build.gradle @@ -1,22 +1,17 @@ apply plugin: 'com.android.application' -repositories { - jcenter() -} - android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" - + compileSdkVersion 29 + buildToolsVersion "29.0.2" defaultConfig { applicationId "com.facebook.device.yearclass.sample" - minSdkVersion 11 - targetSdkVersion 25 + minSdkVersion 14 + targetSdkVersion 29 versionCode 1 versionName "1.0" } } dependencies { - compile project(':yearclass') + implementation project(':yearclass') } diff --git a/yearclass-sample/lint.xml b/yearclass-sample/lint.xml new file mode 100644 index 0000000..7a3e9e5 --- /dev/null +++ b/yearclass-sample/lint.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/yearclass-sample/src/main/AndroidManifest.xml b/yearclass-sample/src/main/AndroidManifest.xml index b52652c..ac0be16 100644 --- a/yearclass-sample/src/main/AndroidManifest.xml +++ b/yearclass-sample/src/main/AndroidManifest.xml @@ -3,8 +3,9 @@ package="com.facebook.device.yearclass.sample"> - - - - + diff --git a/yearclass/src/main/java/com/facebook/device/yearclass/DeviceInfo.java b/yearclass/src/main/java/com/facebook/device/yearclass/DeviceInfo.java index 1c04c9c..1541f65 100644 --- a/yearclass/src/main/java/com/facebook/device/yearclass/DeviceInfo.java +++ b/yearclass/src/main/java/com/facebook/device/yearclass/DeviceInfo.java @@ -34,13 +34,6 @@ public class DeviceInfo { * @return Number of CPU cores in the phone, or DEVICEINFO_UKNOWN = -1 in the event of an error. */ public static int getNumberOfCPUCores() { - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) { - // Gingerbread doesn't support giving a single application access to both cores, but a - // handful of devices (Atrix 4G and Droid X2 for example) were released with a dual-core - // chipset and Gingerbread; that can let an app in the background run without impacting - // the foreground application. But for our purposes, it makes them single core. - return 1; - } int cores; try { cores = getCoresFromFileInfo("/sys/devices/system/cpu/possible");