diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..57872fd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + +env: + GRADLE_USER_HOME: .gradle + SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v1 + + - name: set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: .gradle/caches + key: gradle-cache-${{ hashFiles('**/*.gradle*') }} + restore-keys: gradle-cache + + - name: Run Checks + run: ./gradlew build check test jacocoTestReport jacocoTestCoverageVerification sonarqube --no-daemon diff --git a/android/build.gradle b/android/build.gradle deleted file mode 100644 index 4c0eb00..0000000 --- a/android/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - } - dependencies { - classpath libraries.build.androidGradle - } -} - -repositories { - google() - jcenter() -} - -apply plugin: 'com.android.library' -apply plugin: 'bintray-release' - -android { - compileSdkVersion versions.androidSdk.compile - - defaultConfig { - minSdkVersion versions.androidSdk.min - versionCode 1 - } -} - -dependencies { - implementation libraries.app.supportAppCompatV7 - api project(':java') - - testImplementation libraries.test.jUnit -} - -publish { - userOrg = 'novoda' - groupId = 'com.novoda' - artifactId = 'notils-android' - publishVersion = project.version - desc = 'Never again need a .utils. package yur scurvy Android sea dogs!' - website = 'https://github.com/novoda/NoTils' -} diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..30eb200 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,42 @@ +plugins { + id("com.android.library") + id("bintray-release") + jacoco +} + +repositories { + google() + jcenter() +} + +android { + compileSdkVersion(Versions.AndroidSdk.compile) + + defaultConfig { + minSdkVersion(Versions.AndroidSdk.min) + versionCode = 1 + } +} + +dependencies { + implementation(Libraries.App.supportAppCompat) + api(project(":java")) + + testImplementation(Libraries.Test.jUnit) +} + +publish { + userOrg = "novoda" + groupId = "com.novoda" + artifactId = "notils-android" + publishVersion = project.version as String + desc = "Never again need a .utils. package yur scurvy Android sea dogs!" + website = "https://github.com/novoda/NoTils" +} + +tasks.withType(Test::class.java) { + reports { + html.isEnabled = true + html.destination = file("${buildDir}/reports/jacoco") + } +} diff --git a/android/src/androidTest/java/com/novoda/android/ApplicationTest.java b/android/src/androidTest/java/com/novoda/android/ApplicationTest.java deleted file mode 100644 index f65776e..0000000 --- a/android/src/androidTest/java/com/novoda/android/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.novoda.android; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} diff --git a/android/src/main/java/com/novoda/notils/caster/Fragments.java b/android/src/main/java/com/novoda/notils/caster/Fragments.java index 9355301..8ea1d23 100644 --- a/android/src/main/java/com/novoda/notils/caster/Fragments.java +++ b/android/src/main/java/com/novoda/notils/caster/Fragments.java @@ -1,20 +1,22 @@ package com.novoda.notils.caster; +import androidx.fragment.app.FragmentManager; + public final class Fragments { private Fragments() { } /** - * Simpler version of {@link android.support.v4.app.FragmentManager#findFragmentById(int)}} which infers the target type. + * Simpler version of {@link FragmentManager#findFragmentById(int)}} which infers the target type. */ @SuppressWarnings("unchecked") - public static T findFragmentById(android.support.v4.app.FragmentManager fragmentManager, int fragmentId) { + public static T findFragmentById(FragmentManager fragmentManager, int fragmentId) { return (T) fragmentManager.findFragmentById(fragmentId); } @SuppressWarnings("unchecked") - public static T findFragmentByTag(android.support.v4.app.FragmentManager fragmentManager, String fragmentTag) { + public static T findFragmentByTag(FragmentManager fragmentManager, String fragmentTag) { return (T) fragmentManager.findFragmentByTag(fragmentTag); } diff --git a/android/src/main/java/com/novoda/notils/cursor/CursorListAdapter.java b/android/src/main/java/com/novoda/notils/cursor/CursorListAdapter.java index a35ff5a..24ad22e 100644 --- a/android/src/main/java/com/novoda/notils/cursor/CursorListAdapter.java +++ b/android/src/main/java/com/novoda/notils/cursor/CursorListAdapter.java @@ -3,11 +3,12 @@ import android.content.Context; import android.database.Cursor; import android.database.DataSetObserver; -import android.support.v4.widget.CursorAdapter; import android.view.View; import android.view.ViewGroup; import android.widget.ListAdapter; +import androidx.cursoradapter.widget.CursorAdapter; + public abstract class CursorListAdapter implements ListAdapter { private final CursorAdapter wrappedAdapter; diff --git a/android/src/main/java/com/novoda/notils/devicedetection/DeviceDetection.java b/android/src/main/java/com/novoda/notils/devicedetection/DeviceDetection.java index 268907e..4af3474 100644 --- a/android/src/main/java/com/novoda/notils/devicedetection/DeviceDetection.java +++ b/android/src/main/java/com/novoda/notils/devicedetection/DeviceDetection.java @@ -1,11 +1,12 @@ package com.novoda.notils.devicedetection; -import android.support.annotation.IntDef; import android.util.SparseArray; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import androidx.annotation.IntDef; + public class DeviceDetection { public static final int INTEL = 0; diff --git a/android/src/main/java/com/novoda/notils/fragment/ListenableSupportFragment.java b/android/src/main/java/com/novoda/notils/fragment/ListenableSupportFragment.java index ce047db..ae81d9c 100644 --- a/android/src/main/java/com/novoda/notils/fragment/ListenableSupportFragment.java +++ b/android/src/main/java/com/novoda/notils/fragment/ListenableSupportFragment.java @@ -1,10 +1,11 @@ package com.novoda.notils.fragment; import android.app.Activity; -import android.support.v4.app.Fragment; import com.novoda.notils.caster.Classes; +import androidx.fragment.app.Fragment; + public class ListenableSupportFragment extends Fragment { private L listener; diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 7de6dd5..0000000 --- a/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -buildscript { - apply from: 'dependencies.gradle' - repositories { - google() - jcenter() - } - dependencies { - classpath libraries.build.androidGradle - classpath libraries.build.bintrayRelease - } -} - -allprojects { - version = "3.1.5" - repositories { - jcenter() - mavenCentral() - google() - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..e2cb87a --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,76 @@ +buildscript { + repositories { + google() + jcenter() + } + dependencies { + classpath(Libraries.Build.androidGradle) + classpath(Libraries.Build.bintrayRelease) + } +} + +plugins { + id("org.sonarqube") version "2.8" + jacoco +} + +sonarqube { + androidVariant = "debug" + + properties { + property("sonar.projectName", "NoTils") + property("sonar.projectDescription", "Never again need a .utils. package yur scurvy Java sea dogs!") + property("sonar.projectKey", "novoda_notils") + property("sonar.organization", "novoda") + property("sonar.host.url", "https://sonarcloud.io") + property("sonar.login", System.getenv("SONAR_TOKEN")) + property("sonar.scm.provider", "git") + property("sonar.coverage.jacoco.xmlReportPaths", xmlJacocoReportPaths) + property("sonar.junit.reportPaths", xmlTestReportPaths) + property("sonar.sourceEncoding", "UTF-8") + } +} + +subprojects { + sonarqube { + properties { + property("sonar.sources", "src/main/java") + property("sonar.tests", "src/test/java") + } + } +} + +val Project.xmlTestReportPaths + get() = allprojects.flatMap { it.xmlTestReportFolders }.joinToString(",") + +val Project.xmlTestReportFolders + get() = tasks + .map { it.name } + .filter { it.startsWith("test") } + .map { taskName -> "${project.buildDir}/test-results/$taskName/" } + +val Project.xmlJacocoReportPaths + get() = allprojects.flatMap { it.xmlJacocoReportFolders }.joinToString(",") + +val Project.xmlJacocoReportFolders + get() = tasks + .map { it.name } + .filter { it.startsWith("test") } + .map { taskName -> "${project.buildDir}/reports/jacoco/$taskName/jacocoTestReport.xml" } + +allprojects { + version = "3.1.5" + repositories { + jcenter() + mavenCentral() + google() + } +} + +jacoco { + toolVersion = "0.8.5" +} + +tasks.withType(Test::class.java) { + finalizedBy("jacocoTestReport") +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 0000000..72e4229 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + `kotlin-dsl` +} + +repositories { + jcenter() +} diff --git a/buildSrc/src/main/kotlin/dependencies.kt b/buildSrc/src/main/kotlin/dependencies.kt new file mode 100644 index 0000000..97ad373 --- /dev/null +++ b/buildSrc/src/main/kotlin/dependencies.kt @@ -0,0 +1,27 @@ +import org.gradle.api.JavaVersion + +object Versions { + val sourceCompatibility = JavaVersion.VERSION_1_7 + val targetCompatibility = JavaVersion.VERSION_1_7 + + object AndroidSdk { + const val compile = 29 + const val min = 14 + } +} + +object Libraries { + + object Build { + const val androidGradle = "com.android.tools.build:gradle:3.5.3" + const val bintrayRelease = "com.novoda:bintray-release:0.9" + } + + object App { + const val supportAppCompat = "androidx.appcompat:appcompat:1.1.0" + } + + object Test { + const val jUnit = "junit:junit:4.12" + } +} diff --git a/demo/build.gradle b/demo/build.gradle deleted file mode 100644 index 46d2fa1..0000000 --- a/demo/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 28 - defaultConfig { - applicationId "com.novodo.notils.demo" - minSdkVersion 23 - targetSdkVersion 28 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' - - // notils - // https://github.com/novoda/notils - implementation 'com.novoda:notils-java:3.1.5' - implementation 'com.novoda:notils-android:3.1.5' - - // butterknife - // https://github.com/JakeWharton/butterknife - implementation 'com.jakewharton:butterknife:9.0.0-rc1' - annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' -} diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts new file mode 100644 index 0000000..d5b5d35 --- /dev/null +++ b/demo/build.gradle.kts @@ -0,0 +1,39 @@ +plugins { + id("com.android.application") +} + +android { + compileSdkVersion(29) + defaultConfig { + applicationId = "com.novodo.notils.demo" + minSdkVersion(23) + targetSdkVersion(29) + versionCode = 1 + versionName = "1.0" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } +} + +dependencies { + implementation("androidx.appcompat:appcompat:1.1.0") + implementation("androidx.constraintlayout:constraintlayout:1.1.3") + testImplementation("junit:junit:4.12") + androidTestImplementation("androidx.test:runner:1.2.0") + androidTestImplementation("androidx.test.espresso:espresso-core:3.2.0") + + // notils + // https://github.com/novoda/notils + implementation("com.novoda:notils-java:3.1.5") + implementation("com.novoda:notils-android:3.1.5") + + // butterknife + // https://github.com/JakeWharton/butterknife + implementation("com.jakewharton:butterknife:9.0.0-rc1") + annotationProcessor("com.jakewharton:butterknife-compiler:9.0.0-rc1") +} diff --git a/demo/gradle/wrapper/gradle-wrapper.jar b/demo/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..99340b4 Binary files /dev/null and b/demo/gradle/wrapper/gradle-wrapper.jar differ diff --git a/demo/gradle/wrapper/gradle-wrapper.properties b/demo/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..f2ac20d --- /dev/null +++ b/demo/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Dec 16 17:21:50 GMT 2019 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip diff --git a/demo/gradlew b/demo/gradlew new file mode 100755 index 0000000..cccdd3d --- /dev/null +++ b/demo/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +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="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +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 + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/demo/gradlew.bat b/demo/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/demo/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +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= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/dependencies.gradle b/dependencies.gradle deleted file mode 100644 index 0517991..0000000 --- a/dependencies.gradle +++ /dev/null @@ -1,24 +0,0 @@ -ext { - versions = [ - sourceCompatibility: JavaVersion.VERSION_1_7, - targetCompatibility: JavaVersion.VERSION_1_7, - support : '27.0.2', - androidSdk : [ - compile : 27, - min : 14 - ] - ] - - libraries = [ - build: [ - androidGradle : 'com.android.tools.build:gradle:3.0.1', - bintrayRelease: 'com.novoda:bintray-release:0.8.0' - ], - app: [ - supportAppCompatV7: "com.android.support:appcompat-v7:${versions.support}" - ], - test: [ - jUnit: 'junit:junit:4.12' - ] - ] -} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..23f5485 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,5 @@ +org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.daemon=false +org.gradle.caching=true +org.gradle.configureondemand=true +org.gradle.parallel=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 57c7d2d..f2ac20d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Mon Dec 16 17:21:50 GMT 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip diff --git a/java/build.gradle b/java/build.gradle deleted file mode 100644 index 02ebbae..0000000 --- a/java/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -repositories { - jcenter() -} - -apply plugin: 'java' -apply plugin: 'bintray-release' - -sourceCompatibility = versions.sourceCompatibility -targetCompatibility = versions.targetCompatibility - -dependencies { - testCompile libraries.test.jUnit -} - -publish { - userOrg = 'novoda' - groupId = 'com.novoda' - artifactId = 'notils-java' - publishVersion = project.version - desc = 'Never again need a .utils. package yur scurvy Java sea dogs!' - website = 'https://github.com/novoda/NoTils' -} diff --git a/java/build.gradle.kts b/java/build.gradle.kts new file mode 100644 index 0000000..e4dd18f --- /dev/null +++ b/java/build.gradle.kts @@ -0,0 +1,31 @@ +plugins { + java + id("bintray-release") + jacoco +} + +java { + sourceCompatibility = Versions.sourceCompatibility + targetCompatibility = Versions.targetCompatibility +} + +dependencies { + testImplementation(Libraries.Test.jUnit) +} + +publish { + userOrg = "novoda" + groupId = "com.novoda" + artifactId = "notils-java" + publishVersion = project.version as String + desc = "Never again need a .utils. package yur scurvy Java sea dogs!" + website = "https://github.com/novoda/NoTils" +} + +tasks.jacocoTestReport { + reports { + xml.isEnabled = true + csv.isEnabled = false + html.destination = file("${buildDir}/reports/jacoco") + } +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 70c128c..0000000 --- a/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -include ':android', ':demo' -include ':java' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..e5d0fd7 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1 @@ +include(":android", ":java")