diff --git a/.buckversion b/.buckversion index ee2d5e65d..f6b2ac1df 100644 --- a/.buckversion +++ b/.buckversion @@ -1 +1 @@ -800d5a9669417d5a8b4bc455e34a629422ed1ff1 +cf0c82541709e2c6f77d7a6062097242a5ea7874 diff --git a/build.gradle b/build.gradle index 4314d945c..461f4cddf 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ buildscript { jcenter() google() maven { url "https://plugins.gradle.org/m2/" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev/"} } dependencies { classpath deps.build.androidPlugin @@ -20,6 +21,7 @@ allprojects { project -> repositories { jcenter() google() + maven { url "https://dl.bintray.com/kotlin/kotlin-dev/"} } } @@ -40,10 +42,6 @@ subprojects { project -> } } -task wrapper(type: Wrapper) { - gradleVersion = '4.0' -} - def addCommonConfigurationForJavaModules(Project project) { if (project.plugins.hasPlugin('me.tatarka.retrolambda')) { project.sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 4e41d8bc4..5eca91e37 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -9,6 +9,7 @@ apply from: "../dependencies.gradle" repositories { jcenter() google() + maven { url "https://dl.bintray.com/kotlin/kotlin-dev/"} } tasks.withType(GroovyCompile) { diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidTarget.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidTarget.groovy index 630d8bec5..108572507 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidTarget.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidTarget.groovy @@ -417,7 +417,7 @@ abstract class AndroidTarget extends JavaLibTarget { RuleType getRuleType() { if (isKotlin) { - return RuleType.ANDROID_LIBRARY_WITH_KOTLIN + return RuleType.KOTLIN_ANDROID_LIBRARY } else { return RuleType.ANDROID_LIBRARY } @@ -425,7 +425,7 @@ abstract class AndroidTarget extends JavaLibTarget { RuleType getTestRuleType() { if (isKotlin) { - return RuleType.ROBOLECTRIC_TEST_WITH_KOTLIN + return RuleType.KOTLIN_ROBOLECTRIC_TEST } else { return RuleType.ROBOLECTRIC_TEST } diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/base/RuleType.java b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/base/RuleType.java index 13b954921..4451c0273 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/base/RuleType.java +++ b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/base/RuleType.java @@ -9,7 +9,6 @@ public enum RuleType { ANDROID_INSTRUMENTATION_APK, ANDROID_INSTRUMENTATION_TEST, ANDROID_LIBRARY, - ANDROID_LIBRARY_WITH_KOTLIN("java", "kt"), ANDROID_MANIFEST, ANDROID_RESOURCE, GEN_AIDL, @@ -19,11 +18,12 @@ public enum RuleType { JAVA_BINARY, JAVA_LIBRARY, JAVA_TEST, - KOTLIN_LIBRARY("java", "kt"), - KOTLIN_TEST("java", "kt"), + KOTLIN_ANDROID_LIBRARY("java", "kt"), + KOTLIN_LIBRARY("kt"), + KOTLIN_ROBOLECTRIC_TEST("java", "kt"), + KOTLIN_TEST("kt"), PREBUILT_NATIVE_LIBRARY, - ROBOLECTRIC_TEST, - ROBOLECTRIC_TEST_WITH_KOTLIN("java", "kt"); + ROBOLECTRIC_TEST; private final List sourceExtensions; @@ -42,10 +42,10 @@ public List getSourceExtensions() { public String getBuckName() { RuleType buckType = this; switch (this) { - case ANDROID_LIBRARY_WITH_KOTLIN: + case KOTLIN_ANDROID_LIBRARY: buckType = ANDROID_LIBRARY; break; - case ROBOLECTRIC_TEST_WITH_KOTLIN: + case KOTLIN_ROBOLECTRIC_TEST: buckType = ROBOLECTRIC_TEST; break; default: diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidRule.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidRule.groovy index 17121c08c..d036ef751 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidRule.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidRule.groovy @@ -56,8 +56,8 @@ abstract class AndroidRule extends JavaRule { protected final void printContent(PrintStream printer) { super.printContent(printer) - if (mRuleType == RuleType.ANDROID_LIBRARY_WITH_KOTLIN || - mRuleType == RuleType.ROBOLECTRIC_TEST_WITH_KOTLIN) { + if (mRuleType == RuleType.KOTLIN_ANDROID_LIBRARY || + mRuleType == RuleType.KOTLIN_ROBOLECTRIC_TEST) { printer.println("\tlanguage = 'kotlin',") } diff --git a/buildSrc/src/main/java/com/uber/okbuck/core/util/KotlinUtil.java b/buildSrc/src/main/java/com/uber/okbuck/core/util/KotlinUtil.java index 9334b5655..5e112b053 100644 --- a/buildSrc/src/main/java/com/uber/okbuck/core/util/KotlinUtil.java +++ b/buildSrc/src/main/java/com/uber/okbuck/core/util/KotlinUtil.java @@ -20,7 +20,7 @@ public final class KotlinUtil { private static final String KOTLIN_DEPS_CONFIG = "okbuck_kotlin_deps"; private static final String KOTLIN_GROUP = "org.jetbrains.kotlin"; - private static final String KOTLIN_COMPILER_MODULE = "kotlin-compiler"; + private static final String KOTLIN_COMPILER_MODULE = "kotlin-compiler-embeddable"; private static final String KOTLIN_GRADLE_MODULE = "kotlin-gradle-plugin"; private static final String KOTLIN_STDLIB_MODULE = "kotlin-stdlib"; public static final String KOTLIN_HOME_LOCATION = OkBuckGradlePlugin.DEFAULT_CACHE_PATH + "/kotlin_home"; @@ -42,24 +42,24 @@ public static void setupKotlinHome(Project rootProject) { null); removeVersions(Paths.get(KOTLIN_HOME_LOCATION), - KOTLIN_COMPILER_MODULE, - KOTLIN_STDLIB_MODULE); + KOTLIN_COMPILER_MODULE, "kotlin-compiler"); + removeVersions(Paths.get(KOTLIN_HOME_LOCATION), + KOTLIN_STDLIB_MODULE, KOTLIN_STDLIB_MODULE); } - private static void removeVersions(Path dir, String... toRename) { - for (String rename : toRename) { - try { - Files.walkFileTree(dir, new SimpleFileVisitor() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - String fileName = file.getFileName().toString(); - if (fileName.startsWith(rename)) { - Files.move(file, file.getParent().resolve(rename + ".jar")); - } - return FileVisitResult.CONTINUE; + private static void removeVersions(Path dir, String toRename, String renamed) { + try { + Files.walkFileTree(dir, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws + IOException { + String fileName = file.getFileName().toString(); + if (fileName.startsWith(toRename)) { + Files.move(file, file.getParent().resolve(renamed + ".jar")); } - }); - } catch (IOException ignored) {} - } + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException ignored) {} } } diff --git a/dependencies.gradle b/dependencies.gradle index 2d2e41e1d..1207c4bb3 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ def versions = [ butterKnifeVersion : '8.4.0', daggerVersion : '2.8', - kotlinVersion : '1.1.2', + kotlinVersion : '1.1.3', leakCanaryVersion : '1.5', supportVersion : '25.0.1', androidPluginVersion : '2.3.2', diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 09f9eaa8e..7ae994dbb 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 2c0dff4f3..e95d2d76e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jun 19 15:37:59 PDT 2017 +#Thu Jun 22 18:59:24 PDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-bin.zip