Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Update Gradle Wrapper and plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
friederbluemle committed Feb 28, 2020
1 parent 3a4ca5a commit cc18da8
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 63 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.gradle
/local.properties
/.idea
.gradle/
local.properties
.idea/
*.iml
.DS_Store
/build
build/
.watchmanconfig
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
28 changes: 22 additions & 6 deletions gradlew
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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 " "
}
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -65,7 +65,6 @@ afterEvaluate { project ->
authentication(
userName: getMavenRepositoryUsername(),
password: getMavenRepositoryPassword())

}

pom.project {
Expand Down
1 change: 0 additions & 1 deletion yearclass-sample/.gitignore

This file was deleted.

15 changes: 5 additions & 10 deletions yearclass-sample/build.gradle
Original file line number Diff line number Diff line change
@@ -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')
}
6 changes: 6 additions & 0 deletions yearclass-sample/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="GoogleAppIndexingWarning" severity="ignore"/>
<issue id="GradleDependency" severity="informational"/>
<issue id="OldTargetApi" severity="informational"/>
</lint>
3 changes: 2 additions & 1 deletion yearclass-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
package="com.facebook.device.yearclass.sample">

<application
android:allowBackup="true"
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:fullBackupContent="false"
android:label="@string/app_name">
<activity
android:name=".MainActivity"
Expand Down
1 change: 0 additions & 1 deletion yearclass/.gitignore

This file was deleted.

27 changes: 8 additions & 19 deletions yearclass/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
apply plugin: 'com.android.library'

repositories {
jcenter()
}

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
minSdkVersion 9
targetSdkVersion 25
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
}

dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.0.21-beta'
testCompile ('org.powermock:powermock-api-mockito:1.6.3') {
exclude module: 'hamcrest-core'
exclude module: 'objenesis'
}
testCompile ('org.powermock:powermock-module-junit4:1.6.3') {
exclude module: 'hamcrest-core'
exclude module: 'objenesis'
}
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.0.21-beta'
testImplementation 'org.powermock:powermock-api-mockito:1.6.3'
testImplementation 'org.powermock:powermock-module-junit4:1.6.3'
}

apply from: rootProject.file('release.gradle')
6 changes: 1 addition & 5 deletions yearclass/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.facebook.device.yearclass">

<application/>

<manifest package="com.facebook.device.yearclass">
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit cc18da8

Please sign in to comment.