Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
Bump versions. (#30)
Browse files Browse the repository at this point in the history
Bump Gradle to 6.6
Bump Dagger Reflect to 0.3.0
Bump Kotlinter (and format kotlin code)
  • Loading branch information
Nelson Osacky committed Aug 13, 2020
1 parent c6f0ad6 commit 094056f
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 38 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("com.soundcloud.delect")
}
}

allprojects {
repositories {
Expand All @@ -10,5 +10,5 @@ allprojects {

tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = "6.1.1"
gradleVersion = "6.6"
}
6 changes: 3 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {
plugins {
`kotlin-dsl`
id("java-gradle-plugin")
id("org.jmailen.kotlinter") version "1.25.2"
id("org.jmailen.kotlinter") version "2.4.1"
`maven-publish`
signing
}
Expand All @@ -18,8 +18,8 @@ dependencies {
compileOnly(gradleApi())

testImplementation(gradleTestKit())
testImplementation("junit:junit:4.12")
testImplementation("com.google.truth:truth:0.42")
testImplementation("junit:junit:4.13")
testImplementation("com.google.truth:truth:1.0.1")
}

gradlePlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class DaggerReflectPlugin : Plugin<Project> {
"$reflectDaggerGroupId:dagger-reflect:${extension.daggerReflectVersion}"
)
if (extension.enableReflectLintCheck &&
(maxUnsupportedDaggerLintVersion < VersionNumber.parse(extension.daggerReflectVersion))) {
(maxUnsupportedDaggerLintVersion < VersionNumber.parse(extension.daggerReflectVersion))
) {
whenLintPluginAdded {
add(
"lintChecks",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.soundcloud.reflect

open class DelectExtension {
var daggerReflectVersion = "0.2.0"
var daggerReflectVersion = "0.3.0"
/**
* By default, we use the Reflect Annotation Processor to connect the App's code the the
* Dagger Reflect runtime as outlined in the partial reflection approach:
Expand All @@ -13,4 +13,4 @@ open class DelectExtension {
var addReflectAnnotationProcessor = true

var enableReflectLintCheck = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ class DaggerReflectPluginIntegrationTest {
@Test
fun `test no code generation fails compile when referencing generated code`() {
val fixtureName = "java-module"
testProjectDir.newFile("build.gradle").writeText("""
testProjectDir.newFile("build.gradle").writeText(
"""
plugins {
id 'com.soundcloud.delect'
}
delect {
addReflectAnnotationProcessor = false
}
""".trimIndent())
""".trimIndent()
)

writeSettingsGradle(fixtureName)
copyProjectFixture(fixtureName)
Expand All @@ -60,23 +62,27 @@ class DaggerReflectPluginIntegrationTest {
.withArguments("run")
.buildAndFail()

assertThat(result.output).contains("error: cannot find symbol\n" +
assertThat(result.output).contains(
"error: cannot find symbol\n" +
" AppComponent appComponent = DaggerAppComponent.create();\n" +
" ^\n" +
" symbol: variable DaggerAppComponent")
" symbol: variable DaggerAppComponent"
)
}

@Test
fun `test no code generation succeeds with full reflection`() {
val fixtureName = "java-module-full-reflect"
testProjectDir.newFile("build.gradle").writeText("""
testProjectDir.newFile("build.gradle").writeText(
"""
plugins {
id 'com.soundcloud.delect'
}
delect {
addReflectAnnotationProcessor = false
}
""".trimIndent())
""".trimIndent()
)

writeSettingsGradle(fixtureName)
copyProjectFixture(fixtureName)
Expand All @@ -101,17 +107,21 @@ class DaggerReflectPluginIntegrationTest {
}

private fun writePluginBuildGradle() {
testProjectDir.newFile("build.gradle").writeText("""
testProjectDir.newFile("build.gradle").writeText(
"""
plugins {
id 'com.soundcloud.delect'
}
""".trimIndent())
""".trimIndent()
)
}

private fun writeSettingsGradle(moduleName: String) {
testProjectDir.newFile("settings.gradle").writeText("""
testProjectDir.newFile("settings.gradle").writeText(
"""
include '$moduleName'
""".trimIndent())
""".trimIndent()
)
}

private fun enableDaggerReflect() {
Expand All @@ -121,4 +131,4 @@ class DaggerReflectPluginIntegrationTest {
private fun copyProjectFixture(fixtureName: String) {
File("src/test/fixtures/$fixtureName").copyRecursively(testProjectDir.newFile(fixtureName), true)
}
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ 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
Expand Down Expand Up @@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; 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
Expand Down
25 changes: 7 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@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="-Xmx64m" "-Xms64m"

Expand All @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -51,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -61,28 +64,14 @@ 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%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down

0 comments on commit 094056f

Please sign in to comment.