From 9ff92ff7a51fcfa737ebeadf8fed9d8f8ac87ea3 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 20 Jun 2017 10:41:34 -0700 Subject: [PATCH 01/25] Bump to gradle 4.0 stable. (#454) --- build.gradle | 4 ++++ gradle/wrapper/gradle-wrapper.jar | Bin 54212 -> 54711 bytes gradle/wrapper/gradle-wrapper.properties | 4 ++-- gradlew | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index bab72c700..4314d945c 100644 --- a/build.gradle +++ b/build.gradle @@ -40,6 +40,10 @@ 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/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 0f0ed5820fbb731eb6b2d6d8a00055aa98c6d4be..09f9eaa8e959ff13b3ba7b6b02ec1d50eb39e091 100644 GIT binary patch delta 19319 zcmZ5{V{m3&vvwx7ZQHhO+qSKHl1c73nb@{%O+2w}+xGXI_j&89I_Jl(?&{rZRqd*4 zcdzcg)?g`EYb6+>vK$yVItU0fGzbWY2uM641;YQx@HU{Az&{rCcwrTcjGs++u0KHj zk7orj_bJ@7yC`}8IjnW-J)|2coNEvbQJBSmG{55%q7$| z8#4kt7<+}HftTsHChPywK}0w=_P>L$|A`POcbveS!* zFiI;U9{rdL|V)%)}JN< zLakoyrjT*?$=I&P$T$}Ut7-_hb6oqSiunccd&Hp<6)v&#z@e6l(hb4m-bR~GBXDImXwKb<|WfE41J=K zYQ$GA=kzK$LsSU;;FwDDc*PIM|Bag8w79-slP>jvEi3bToz*V-Os#`6rjwVfAfrJh zn->c(NJngMj9$|nty`bfkBp*MkJS%g(E4o#aC_lK4>IFs9kTz00IWA^J8`_1DN|_X z76J?qE|f4yG=3BX*%Knfa#Q-kw))|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Nq{ke4( z;5fMC=?wR7*zq|p!y48&UsUJLi$W+m6_^u7epSoU$9T4Pp(8cpLp49Q!m6l@(V0 zrMEaXARlEi*n7*7kj zaH4sSK5ge%Lp2$!IJK)andJtKy;6&WV(2zZBO$&jZ_v}XD8f~Bgg|Z*6X3q4!IB6J zDF$;9NC7{-0@bNO) Date: Thu, 22 Jun 2017 14:08:48 -0700 Subject: [PATCH 02/25] Add option to exclude some resources from aapt (#455) --- .../java/com/uber/okbuck/core/task/OkBuckTask.java | 10 +++++++++- .../com/uber/okbuck/extension/OkBuckExtension.java | 6 ++++++ .../util/defs/{OKBUCK_DEFS => OKBUCK_DEFS_TEMPLATE} | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) rename buildSrc/src/main/resources/com/uber/okbuck/core/util/defs/{OKBUCK_DEFS => OKBUCK_DEFS_TEMPLATE} (95%) diff --git a/buildSrc/src/main/java/com/uber/okbuck/core/task/OkBuckTask.java b/buildSrc/src/main/java/com/uber/okbuck/core/task/OkBuckTask.java index ee889446e..a0cc17304 100644 --- a/buildSrc/src/main/java/com/uber/okbuck/core/task/OkBuckTask.java +++ b/buildSrc/src/main/java/com/uber/okbuck/core/task/OkBuckTask.java @@ -1,5 +1,8 @@ package com.uber.okbuck.core.task; +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableMap; + import com.uber.okbuck.OkBuckGradlePlugin; import com.uber.okbuck.core.model.base.ProjectType; import com.uber.okbuck.core.util.FileUtil; @@ -87,7 +90,12 @@ private void generate(OkBuckExtension okbuckExt, String groovyHome, String kotli } // Setup defs - FileUtil.copyResourceToProject("defs/OKBUCK_DEFS", okbuckDefs()); + FileUtil.copyResourceToProject("defs/OKBUCK_DEFS_TEMPLATE", okbuckDefs(), + ImmutableMap.of("template-resource-excludes", Joiner.on(", ") + .join(okBuckExtension.excludeResources + .stream() + .map(s -> "'" + s + "'") + .collect(Collectors.toSet())))); Set defs = okbuckExt.extraDefs.stream() .map(it -> "//" + FileUtil.getRelativePath(getProject().getRootDir(), it)) .collect(Collectors.toSet()); diff --git a/buildSrc/src/main/java/com/uber/okbuck/extension/OkBuckExtension.java b/buildSrc/src/main/java/com/uber/okbuck/extension/OkBuckExtension.java index 1b7113ffe..f8538f3c5 100644 --- a/buildSrc/src/main/java/com/uber/okbuck/extension/OkBuckExtension.java +++ b/buildSrc/src/main/java/com/uber/okbuck/extension/OkBuckExtension.java @@ -78,6 +78,12 @@ public class OkBuckExtension { @Input public boolean resourceUnion = true; + /** + * List of exclude patterns for resources to be processed by aapt + */ + @Input + public Set excludeResources = new HashSet<>(); + /** * Additional dependency caches. * Every entry will create a new configuration "entryDepCache" diff --git a/buildSrc/src/main/resources/com/uber/okbuck/core/util/defs/OKBUCK_DEFS b/buildSrc/src/main/resources/com/uber/okbuck/core/util/defs/OKBUCK_DEFS_TEMPLATE similarity index 95% rename from buildSrc/src/main/resources/com/uber/okbuck/core/util/defs/OKBUCK_DEFS rename to buildSrc/src/main/resources/com/uber/okbuck/core/util/defs/OKBUCK_DEFS_TEMPLATE index 3c4b94877..7a218394c 100644 --- a/buildSrc/src/main/resources/com/uber/okbuck/core/util/defs/OKBUCK_DEFS +++ b/buildSrc/src/main/resources/com/uber/okbuck/core/util/defs/OKBUCK_DEFS_TEMPLATE @@ -26,6 +26,7 @@ def res_glob(glob_specs): results = {} for dirpath, glob_pattern in glob_specs: - results[dirpath] = subdir_glob([(dirpath, glob_pattern)]) + results[dirpath] = subdir_glob([(dirpath, glob_pattern)], + excludes=[${template-resource-excludes}]) return merge_maps(**results) From d30aaf4888d3e1ad1afd960ed3724c086a5217cf Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 22 Jun 2017 15:35:37 -0700 Subject: [PATCH 03/25] Prefer abstractions over implementations for upcoming kotlin refactors (#456) --- .../groovy/GroovyLibraryRuleComposer.groovy | 20 ++- .../groovy/GroovyTestRuleComposer.groovy | 15 +- .../kotlin/KotlinLibraryRuleComposer.groovy | 6 +- .../kotlin/KotlinTestRuleComposer.groovy | 7 +- .../uber/okbuck/core/model/base/RuleType.java | 25 ++-- .../okbuck/rule/android/AndroidRule.groovy | 136 ++---------------- .../okbuck/rule/groovy/GroovyLibraryRule.java | 41 ------ .../uber/okbuck/rule/groovy/GroovyRule.groovy | 127 ---------------- .../okbuck/rule/groovy/GroovyTestRule.java | 44 ------ .../com/uber/okbuck/rule/java/JavaRule.groovy | 22 ++- .../okbuck/rule/kotlin/KotlinLibraryRule.java | 42 ------ .../okbuck/rule/kotlin/KotlinTestRule.java | 47 ------ 12 files changed, 70 insertions(+), 462 deletions(-) delete mode 100644 buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyLibraryRule.java delete mode 100644 buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyRule.groovy delete mode 100644 buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyTestRule.java delete mode 100644 buildSrc/src/main/groovy/com/uber/okbuck/rule/kotlin/KotlinLibraryRule.java delete mode 100644 buildSrc/src/main/groovy/com/uber/okbuck/rule/kotlin/KotlinTestRule.java diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyLibraryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyLibraryRuleComposer.groovy index 6d3e3a009..562c1d7a6 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyLibraryRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyLibraryRuleComposer.groovy @@ -4,7 +4,7 @@ import com.uber.okbuck.composer.jvm.JvmBuckRuleComposer import com.uber.okbuck.core.model.base.RuleType import com.uber.okbuck.core.model.groovy.GroovyLibTarget import com.uber.okbuck.core.util.RetrolambdaUtil -import com.uber.okbuck.rule.groovy.GroovyLibraryRule +import com.uber.okbuck.rule.java.JavaLibraryRule final class GroovyLibraryRuleComposer extends JvmBuckRuleComposer { @@ -12,7 +12,7 @@ final class GroovyLibraryRuleComposer extends JvmBuckRuleComposer { // no instance } - static GroovyLibraryRule compose(GroovyLibTarget target) { + static JavaLibraryRule compose(GroovyLibTarget target) { List deps = [] deps.addAll(external(target.main.externalDeps)) deps.addAll(targets(target.main.targetDeps)) @@ -26,18 +26,26 @@ final class GroovyLibraryRuleComposer extends JvmBuckRuleComposer { providedDeps.add(RetrolambdaUtil.getRtStubJarRule()) } - new GroovyLibraryRule( + List testTargets = [] + if (target.test.sources) { + testTargets.add(":${test(target)}") + } + + new JavaLibraryRule( src(target), ["PUBLIC"], deps, target.main.sources, - [] as Set, - [] as Set, + Collections.emptySet(), + Collections.emptySet(), providedDeps, target.main.resourcesDir, target.sourceCompatibility, target.targetCompatibility, + Collections.emptyList(), target.main.jvmArgs, - target.getExtraOpts(RuleType.GROOVY_LIBRARY)) + testTargets, + target.getExtraOpts(RuleType.GROOVY_LIBRARY), + RuleType.GROOVY_LIBRARY) } } diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyTestRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyTestRuleComposer.groovy index 225b0aed6..21ce24ab3 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyTestRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyTestRuleComposer.groovy @@ -4,7 +4,7 @@ import com.uber.okbuck.composer.jvm.JvmBuckRuleComposer import com.uber.okbuck.core.model.base.RuleType import com.uber.okbuck.core.model.groovy.GroovyLibTarget import com.uber.okbuck.core.util.RetrolambdaUtil -import com.uber.okbuck.rule.groovy.GroovyTestRule +import com.uber.okbuck.rule.java.JavaTestRule final class GroovyTestRuleComposer extends JvmBuckRuleComposer { @@ -12,7 +12,7 @@ final class GroovyTestRuleComposer extends JvmBuckRuleComposer { // no instance } - static GroovyTestRule compose(GroovyLibTarget target) { + static JavaTestRule compose(GroovyLibTarget target) { List deps = [] deps.add(":${src(target)}") deps.addAll(external(target.test.externalDeps)) @@ -27,19 +27,22 @@ final class GroovyTestRuleComposer extends JvmBuckRuleComposer { providedDeps.add(RetrolambdaUtil.getRtStubJarRule()) } - new GroovyTestRule( + new JavaTestRule( test(target), ["PUBLIC"], deps, target.test.sources, - [] as Set, - [] as Set, + Collections.emptySet(), + Collections.emptySet(), providedDeps, target.test.resourcesDir, target.sourceCompatibility, target.targetCompatibility, + Collections.emptyList(), target.test.jvmArgs, target.testOptions, - target.getExtraOpts(RuleType.GROOVY_TEST)) + target.getExtraOpts(RuleType.GROOVY_TEST), + RuleType.GROOVY_TEST, + Arrays.asList("unit", "groovy")) } } diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinLibraryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinLibraryRuleComposer.groovy index f6133b06a..98a165389 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinLibraryRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinLibraryRuleComposer.groovy @@ -4,7 +4,6 @@ import com.uber.okbuck.composer.jvm.JvmBuckRuleComposer import com.uber.okbuck.core.model.base.RuleType import com.uber.okbuck.core.model.kotlin.KotlinLibTarget import com.uber.okbuck.rule.java.JavaLibraryRule -import com.uber.okbuck.rule.kotlin.KotlinLibraryRule final class KotlinLibraryRuleComposer extends JvmBuckRuleComposer { @@ -27,7 +26,7 @@ final class KotlinLibraryRuleComposer extends JvmBuckRuleComposer { testTargets.add(":${test(target)}") } - new KotlinLibraryRule( + new JavaLibraryRule( src(target), ["PUBLIC"], deps, @@ -41,6 +40,7 @@ final class KotlinLibraryRuleComposer extends JvmBuckRuleComposer { Collections.emptyList(), target.main.jvmArgs, testTargets, - target.getExtraOpts(RuleType.KOTLIN_LIBRARY)) + target.getExtraOpts(RuleType.KOTLIN_LIBRARY), + RuleType.KOTLIN_LIBRARY) } } diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinTestRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinTestRuleComposer.groovy index 4e0e26fa5..beda79bb3 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinTestRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinTestRuleComposer.groovy @@ -4,7 +4,6 @@ import com.uber.okbuck.composer.jvm.JvmBuckRuleComposer import com.uber.okbuck.core.model.base.RuleType import com.uber.okbuck.core.model.kotlin.KotlinLibTarget import com.uber.okbuck.rule.java.JavaTestRule -import com.uber.okbuck.rule.kotlin.KotlinTestRule final class KotlinTestRuleComposer extends JvmBuckRuleComposer { @@ -23,7 +22,7 @@ final class KotlinTestRuleComposer extends JvmBuckRuleComposer { providedDeps.addAll(targets(target.testProvided.targetDeps)) providedDeps.removeAll(deps) - new KotlinTestRule( + new JavaTestRule( test(target), ["PUBLIC"], deps, @@ -37,6 +36,8 @@ final class KotlinTestRuleComposer extends JvmBuckRuleComposer { Collections.emptyList(), target.test.jvmArgs, target.testOptions, - target.getExtraOpts(RuleType.KOTLIN_TEST)) + target.getExtraOpts(RuleType.KOTLIN_TEST), + RuleType.KOTLIN_TEST, + Arrays.asList("unit", "kotlin")) } } 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 c4ead06b3..7b060b9f9 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 @@ -1,36 +1,41 @@ package com.uber.okbuck.core.model.base; +import java.util.Arrays; +import java.util.List; + public enum RuleType { ANDROID_BINARY, ANDROID_BUILD_CONFIG, ANDROID_INSTRUMENTATION_APK, ANDROID_INSTRUMENTATION_TEST, ANDROID_LIBRARY, + ANDROID_LIBRARY_WITH_KOTLIN("java", "kt"), ANDROID_MANIFEST, ANDROID_RESOURCE, GEN_AIDL, GENRULE, - GROOVY_LIBRARY, - GROOVY_TEST, + GROOVY_LIBRARY("groovy", "java"), + GROOVY_TEST("groovy", "java"), JAVA_BINARY, JAVA_LIBRARY, JAVA_TEST, - KOTLIN_LIBRARY("kt"), - KOTLIN_TEST("kt"), + KOTLIN_LIBRARY("java", "kt"), + KOTLIN_TEST("java", "kt"), PREBUILT_NATIVE_LIBRARY, - ROBOLECTRIC_TEST; + ROBOLECTRIC_TEST, + ROBOLECTRIC_TEST_WITH_KOTLIN("java", "kt"); - private final String sourceExtension; + private final List sourceExtensions; RuleType() { this("java"); } - RuleType(String sourceExtension) { - this.sourceExtension = sourceExtension; + RuleType(String... extensions) { + this.sourceExtensions = Arrays.asList(extensions); } - public String getSourceExtension() { - return sourceExtension; + public List getSourceExtensions() { + return sourceExtensions; } } 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 ba8d4f081..bdc77d242 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 @@ -2,34 +2,17 @@ package com.uber.okbuck.rule.android import com.uber.okbuck.core.model.base.RuleType import com.uber.okbuck.core.model.jvm.TestOptions -import com.uber.okbuck.rule.base.BuckRule +import com.uber.okbuck.rule.java.JavaRule import org.apache.commons.lang.StringUtils -abstract class AndroidRule extends BuckRule { +abstract class AndroidRule extends JavaRule { - private final Set mSrcSet private final String mManifest private final String mRobolectricManifest - private final List mAnnotationProcessors - private final List mAptDeps private final List mAidlRuleNames - private final String mAppClass - private final String mSourceCompatibility - private final String mTargetCompatibility - private final List mPostprocessClassesCommands - private final List mOptions - private final TestOptions mTestOptions - private final Set mProvidedDeps private final boolean mGenerateR2 - private final String mResourcesDir private final String mRuntimeDependency - private final List mTestTargets - private final List mLabels - /** - * @srcTargets , used for SqlDelight support(or other case), genrule's output will be used as src, pass empty set if not present - * @param appClass , if exopackage is enabled, pass the detected app class, otherwise, pass null - * */ AndroidRule( RuleType ruleType, String name, @@ -54,58 +37,22 @@ abstract class AndroidRule extends BuckRule { List testTargets, List labels = null, Set extraOpts = []) { - super(ruleType, name, visibility, deps, extraOpts) + super(ruleType, name, visibility, deps, srcSet, annotationProcessors, aptDeps, providedDeps, + resourcesDir, sourceCompatibility, targetCompatibility, postprocessClassesCommands, + options, testOptions, testTargets, labels, extraOpts, + !StringUtils.isEmpty(appClass) + ? Collections.singleton(appClass) : Collections.emptySet()) - mSrcSet = srcSet mManifest = manifest mRobolectricManifest = robolectricManifest - mAnnotationProcessors = annotationProcessors - mAptDeps = aptDeps mAidlRuleNames = aidlRuleNames - mAppClass = appClass - mSourceCompatibility = sourceCompatibility - mTargetCompatibility = targetCompatibility - mPostprocessClassesCommands = postprocessClassesCommands - mOptions = options - mTestOptions = testOptions - mProvidedDeps = providedDeps mGenerateR2 = generateR2 - mResourcesDir = resourcesDir mRuntimeDependency = runtimeDependency - mTestTargets = testTargets - mLabels = labels } @Override protected final void printContent(PrintStream printer) { - if (!mSrcSet.empty) { - printer.println("\tsrcs = glob([") - for (String src : mSrcSet) { - printer.println("\t\t'${src}/**/*.java',") - } - - if (!StringUtils.isEmpty(mAppClass)) { - printer.println("\t], excludes = ['${mAppClass}']),") - } else { - printer.println("\t]),") - } - } - - if (mTestTargets) { - printer.println("\ttests = [") - for (String testTarget : mTestTargets) { - printer.println("\t\t'${testTarget}',") - } - printer.println("\t],") - } - - if (mResourcesDir) { - printer.println("\tresources = glob([") - printer.println("\t\t'${mResourcesDir}/**',") - printer.println("\t]),") - - printer.println("\tresources_root = '${mResourcesDir}',") - } + super.printContent(printer) if (!StringUtils.isEmpty(mManifest)) { printer.println("\tmanifest = '${mManifest}',") @@ -115,30 +62,6 @@ abstract class AndroidRule extends BuckRule { printer.println("\trobolectric_manifest = '${mRobolectricManifest}',") } - if (!mAnnotationProcessors.empty) { - printer.println("\tannotation_processors = [") - for (String processor : mAnnotationProcessors) { - printer.println("\t\t'${processor}',") - } - printer.println("\t],") - } - - if (!mAptDeps.empty) { - printer.println("\tannotation_processor_deps = [") - for (String dep : mAptDeps.sort()) { - printer.println("\t\t'${dep}',") - } - printer.println("\t],") - } - - if (!mProvidedDeps.empty) { - printer.println("\tprovided_deps = [") - for (String dep : mProvidedDeps.sort()) { - printer.println("\t\t'${dep}',") - } - printer.println("\t],") - } - if (!mAidlRuleNames.empty) { printer.println("\texported_deps = [") mAidlRuleNames.sort().each { String aidlRuleName -> @@ -147,25 +70,6 @@ abstract class AndroidRule extends BuckRule { printer.println("\t],") } - printer.println("\tsource = '${mSourceCompatibility}',") - printer.println("\ttarget = '${mTargetCompatibility}',") - - if (!mOptions.empty) { - printer.println("\textra_arguments = [") - mOptions.each { String option -> - printer.println("\t\t'${option}',") - } - printer.println("\t],") - } - - if (!mPostprocessClassesCommands.empty) { - printer.println("\tpostprocess_classes_commands = [") - mPostprocessClassesCommands.each { String cmd -> - printer.println("\t\t'${cmd}',") - } - printer.println("\t],") - } - if (mGenerateR2) { printer.println("\tfinal_r_name = 'R2',") } @@ -173,29 +77,5 @@ abstract class AndroidRule extends BuckRule { if (mRuntimeDependency) { printer.println("\trobolectric_runtime_dependency = '${mRuntimeDependency}',") } - - if (mLabels) { - printer.println("\tlabels = [") - mLabels.each { String label -> - printer.println("\t\t'${label}',") - } - printer.println("\t],") - } - - if (mTestOptions.jvmArgs) { - printer.println("\tvm_args = [") - mTestOptions.jvmArgs.each { String arg -> - printer.println("\t\t'${arg}',") - } - printer.println("\t],") - } - - if (mTestOptions.env) { - printer.println("\tenv = {") - mTestOptions.env.each { String key, Object value -> - printer.println("\t\t'${key}': '${value.toString()}',") - } - printer.println("\t},") - } } } diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyLibraryRule.java b/buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyLibraryRule.java deleted file mode 100644 index 027f9bc1b..000000000 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyLibraryRule.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.uber.okbuck.rule.groovy; - -import com.uber.okbuck.core.model.base.RuleType; -import com.uber.okbuck.core.model.jvm.TestOptions; - -import java.util.Collections; -import java.util.List; -import java.util.Set; - -public final class GroovyLibraryRule extends GroovyRule { - - public GroovyLibraryRule( - String name, - List visibility, - List deps, - Set srcSet, - Set annotationProcessors, - Set aptDeps, - Set providedDeps, - String resourcesDir, - String sourceCompatibility, - String targetCompatibility, - List javacOptions, - Set extraOpts) { - super(RuleType.GROOVY_LIBRARY, - name, - visibility, - deps, - srcSet, - annotationProcessors, - aptDeps, - providedDeps, - resourcesDir, - sourceCompatibility, - targetCompatibility, - javacOptions, - TestOptions.EMPTY, - Collections.emptyList(), - extraOpts); - } -} diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyRule.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyRule.groovy deleted file mode 100644 index e94386edc..000000000 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyRule.groovy +++ /dev/null @@ -1,127 +0,0 @@ -package com.uber.okbuck.rule.groovy - -import com.uber.okbuck.core.model.base.RuleType -import com.uber.okbuck.core.model.jvm.TestOptions -import com.uber.okbuck.rule.base.BuckRule -import org.apache.commons.lang.StringUtils - -abstract class GroovyRule extends BuckRule { - - private final Set mSrcSet - private final Set mAnnotationProcessors - private final Set mAnnotationProcessorDeps - private final String mResourcesDir - private final String mSourceCompatibility - private final String mTargetCompatibility - private final List mJavacOptions - private final TestOptions mTestOptions - private final Set mProvidedDeps - private final List mLabels - - GroovyRule( - RuleType ruleType, - String name, - List visibility, - List deps, - Set srcSet, - Set annotationProcessors, - Set aptDeps, - Set providedDeps, - String resourcesDir, - String sourceCompatibility, - String targetCompatibility, - List javacOptions, - TestOptions testOptions, - List labels, - Set extraOpts) { - - super(ruleType, name, visibility, deps, extraOpts) - mSrcSet = srcSet - mAnnotationProcessors = annotationProcessors - mAnnotationProcessorDeps = aptDeps - mSourceCompatibility = sourceCompatibility - mTargetCompatibility = targetCompatibility - mResourcesDir = resourcesDir - mJavacOptions = javacOptions - mTestOptions = testOptions - mProvidedDeps = providedDeps - mLabels = labels - } - - @Override - protected final void printContent(PrintStream printer) { - if (!mSrcSet.empty) { - printer.println("\tsrcs = glob([") - for (String src : mSrcSet) { - printer.println("\t\t'${src}/**/*.java',") - printer.println("\t\t'${src}/**/*.groovy',") - } - printer.println("\t]),") - } - - if (!StringUtils.isEmpty(mResourcesDir)) { - printer.println("\tresources = glob([") - printer.println("\t\t'${mResourcesDir}/**',") - printer.println("\t]),") - } - - if (!mAnnotationProcessors.empty) { - printer.println("\tannotation_processors = [") - mAnnotationProcessors.sort().each { String processor -> - printer.println("\t\t'${processor}',") - } - printer.println("\t],") - } - - if (!mAnnotationProcessorDeps.empty) { - printer.println("\tannotation_processor_deps = [") - for (String dep : mAnnotationProcessorDeps.sort()) { - printer.println("\t\t'${dep}',") - } - printer.println("\t],") - } - - if (!mProvidedDeps.empty) { - printer.println("\tprovided_deps = [") - for (String dep : mProvidedDeps.sort()) { - printer.println("\t\t'${dep}',") - } - printer.println("\t],") - } - - printer.println("\tsource = '${mSourceCompatibility}',") - printer.println("\ttarget = '${mTargetCompatibility}',") - - if (!mJavacOptions.empty) { - printer.println("\textra_arguments = [") - mJavacOptions.each { String option -> - printer.println("\t\t'${option}',") - } - printer.println("\t],") - } - - if (mLabels) { - printer.println("\tlabels = [") - mLabels.each { String label -> - printer.println("\t\t'${label}',") - } - printer.println("\t],") - } - - if (mTestOptions.jvmArgs) { - printer.println("\tvm_args = [") - mTestOptions.jvmArgs.each { String arg -> - printer.println("\t\t'${arg}',") - } - printer.println("\t],") - } - - if (mTestOptions.env) { - printer.println("\tenv = {") - mTestOptions.env.each { String key, Object value -> - printer.println("\t\t'${key}': '${value.toString()}',") - } - printer.println("\t},") - } - } -} diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyTestRule.java b/buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyTestRule.java deleted file mode 100644 index 7412850d6..000000000 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/groovy/GroovyTestRule.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.uber.okbuck.rule.groovy; - -import com.uber.okbuck.core.model.base.RuleType; -import com.uber.okbuck.core.model.jvm.TestOptions; - -import java.util.Arrays; -import java.util.List; -import java.util.Set; - -public final class GroovyTestRule extends GroovyRule { - - private static final List GROOVY_TEST_LABELS = Arrays.asList("unit", "groovy"); - - public GroovyTestRule( - String name, - List visibility, - List deps, - Set srcSet, - Set annotationProcessors, - Set aptDeps, - Set providedDeps, - String resourcesDir, - String sourceCompatibility, - String targetCompatibility, - List javacOptions, - TestOptions testOptions, - Set extraOpts) { - super(RuleType.GROOVY_TEST, - name, - visibility, - deps, - srcSet, - annotationProcessors, - aptDeps, - providedDeps, - resourcesDir, - sourceCompatibility, - targetCompatibility, - javacOptions, - testOptions, - GROOVY_TEST_LABELS, - extraOpts); - } -} diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaRule.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaRule.groovy index 1dc19c459..3869f24f0 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaRule.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaRule.groovy @@ -18,7 +18,8 @@ abstract class JavaRule extends BuckRule { private final Set mProvidedDeps private final List mTestTargets private final List mLabels - private final String mSourceExtension + private final Set mExcludes + private final Set mSourceExtensions JavaRule( RuleType ruleType, @@ -37,7 +38,8 @@ abstract class JavaRule extends BuckRule { TestOptions testOptions, List testTargets, List labels = null, - Set extraOpts = []) { + Set extraOpts = [], + Set excludes = []) { super(ruleType, name, visibility, deps, extraOpts) mSrcSet = srcSet @@ -52,15 +54,25 @@ abstract class JavaRule extends BuckRule { mProvidedDeps = providedDeps mTestTargets = testTargets mLabels = labels - mSourceExtension = ruleType.getSourceExtension(); + mExcludes = excludes + mSourceExtensions = ruleType.getSourceExtensions() } @Override - protected final void printContent(PrintStream printer) { + protected void printContent(PrintStream printer) { if (!mSrcSet.empty) { printer.println("\tsrcs = glob([") for (String src : mSrcSet) { - printer.println("\t\t'${src}/**/*.${mSourceExtension}',") + for (String ext: mSourceExtensions) { + printer.println("\t\t'${src}/**/*.${ext}',") + } + } + + if (!mExcludes.empty) { + printer.println("\t], excludes = [") + for (String exclude : mExcludes) { + printer.println("\t\t'${exclude}',") + } } printer.println("\t]),") } diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/kotlin/KotlinLibraryRule.java b/buildSrc/src/main/groovy/com/uber/okbuck/rule/kotlin/KotlinLibraryRule.java deleted file mode 100644 index 0201d1217..000000000 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/kotlin/KotlinLibraryRule.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.uber.okbuck.rule.kotlin; - -import com.uber.okbuck.core.model.base.RuleType; -import com.uber.okbuck.rule.java.JavaLibraryRule; - -import java.util.List; -import java.util.Set; - -public final class KotlinLibraryRule extends JavaLibraryRule { - - public KotlinLibraryRule( - String name, - List visibility, - List deps, - Set srcSet, - Set annotationProcessors, - Set aptDeps, - Set providedDeps, - String resourcesDir, - String sourceCompatibility, - String targetCompatibility, - List postprocessClassesCommands, - List options, - List testTargets, - Set extraOpts) { - super(name, - visibility, - deps, - srcSet, - annotationProcessors, - aptDeps, - providedDeps, - resourcesDir, - sourceCompatibility, - targetCompatibility, - postprocessClassesCommands, - options, - testTargets, - extraOpts, - RuleType.KOTLIN_LIBRARY); - } -} diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/kotlin/KotlinTestRule.java b/buildSrc/src/main/groovy/com/uber/okbuck/rule/kotlin/KotlinTestRule.java deleted file mode 100644 index cc3fa4c6b..000000000 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/kotlin/KotlinTestRule.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.uber.okbuck.rule.kotlin; - -import com.uber.okbuck.core.model.base.RuleType; -import com.uber.okbuck.core.model.jvm.TestOptions; -import com.uber.okbuck.rule.java.JavaTestRule; - -import java.util.Arrays; -import java.util.List; -import java.util.Set; - -public final class KotlinTestRule extends JavaTestRule { - - private static final List KOTLIN_TEST_LABELS = Arrays.asList("unit", "kotlin"); - - public KotlinTestRule( - String name, - List visibility, - List deps, - Set srcSet, - Set annotationProcessors, - Set aptDeps, - Set providedDeps, - String resourcesDir, - String sourceCompatibility, - String targetCompatibility, - List postprocessClassesCommands, - List options, - TestOptions testOptions, - Set extraOpts) { - super(name, - visibility, - deps, - srcSet, - annotationProcessors, - aptDeps, - providedDeps, - resourcesDir, - sourceCompatibility, - targetCompatibility, - postprocessClassesCommands, - options, - testOptions, - extraOpts, - RuleType.KOTLIN_TEST, - KOTLIN_TEST_LABELS); - } -} From 02999887bc1ce01fc83c245ccd66691c2e2690f9 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 22 Jun 2017 16:12:58 -0700 Subject: [PATCH 04/25] Use more abstractions (#457) --- .../groovy/GroovyLibraryRuleComposer.groovy | 51 ------------------- .../groovy/GroovyTestRuleComposer.groovy | 48 ----------------- .../java/JavaBinaryRuleComposer.groovy | 4 +- .../java/JavaLibraryRuleComposer.groovy | 5 +- .../composer/java/JavaTestRuleComposer.groovy | 5 +- .../kotlin/KotlinLibraryRuleComposer.groovy | 46 ----------------- .../kotlin/KotlinTestRuleComposer.groovy | 43 ---------------- .../okbuck/generator/BuckFileGenerator.groovy | 13 ++--- 8 files changed, 13 insertions(+), 202 deletions(-) delete mode 100644 buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyLibraryRuleComposer.groovy delete mode 100644 buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyTestRuleComposer.groovy delete mode 100644 buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinLibraryRuleComposer.groovy delete mode 100644 buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinTestRuleComposer.groovy diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyLibraryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyLibraryRuleComposer.groovy deleted file mode 100644 index 562c1d7a6..000000000 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyLibraryRuleComposer.groovy +++ /dev/null @@ -1,51 +0,0 @@ -package com.uber.okbuck.composer.groovy - -import com.uber.okbuck.composer.jvm.JvmBuckRuleComposer -import com.uber.okbuck.core.model.base.RuleType -import com.uber.okbuck.core.model.groovy.GroovyLibTarget -import com.uber.okbuck.core.util.RetrolambdaUtil -import com.uber.okbuck.rule.java.JavaLibraryRule - -final class GroovyLibraryRuleComposer extends JvmBuckRuleComposer { - - private GroovyLibraryRuleComposer() { - // no instance - } - - static JavaLibraryRule compose(GroovyLibTarget target) { - List deps = [] - deps.addAll(external(target.main.externalDeps)) - deps.addAll(targets(target.main.targetDeps)) - - Set providedDeps = [] - providedDeps.addAll(external(target.provided.externalDeps)) - providedDeps.addAll(targets(target.provided.targetDeps)) - providedDeps.removeAll(deps) - - if (target.retrolambda) { - providedDeps.add(RetrolambdaUtil.getRtStubJarRule()) - } - - List testTargets = [] - if (target.test.sources) { - testTargets.add(":${test(target)}") - } - - new JavaLibraryRule( - src(target), - ["PUBLIC"], - deps, - target.main.sources, - Collections.emptySet(), - Collections.emptySet(), - providedDeps, - target.main.resourcesDir, - target.sourceCompatibility, - target.targetCompatibility, - Collections.emptyList(), - target.main.jvmArgs, - testTargets, - target.getExtraOpts(RuleType.GROOVY_LIBRARY), - RuleType.GROOVY_LIBRARY) - } -} diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyTestRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyTestRuleComposer.groovy deleted file mode 100644 index 21ce24ab3..000000000 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/groovy/GroovyTestRuleComposer.groovy +++ /dev/null @@ -1,48 +0,0 @@ -package com.uber.okbuck.composer.groovy - -import com.uber.okbuck.composer.jvm.JvmBuckRuleComposer -import com.uber.okbuck.core.model.base.RuleType -import com.uber.okbuck.core.model.groovy.GroovyLibTarget -import com.uber.okbuck.core.util.RetrolambdaUtil -import com.uber.okbuck.rule.java.JavaTestRule - -final class GroovyTestRuleComposer extends JvmBuckRuleComposer { - - private GroovyTestRuleComposer() { - // no instance - } - - static JavaTestRule compose(GroovyLibTarget target) { - List deps = [] - deps.add(":${src(target)}") - deps.addAll(external(target.test.externalDeps)) - deps.addAll(targets(target.test.targetDeps)) - - Set providedDeps = [] - providedDeps.addAll(external(target.testProvided.externalDeps)) - providedDeps.addAll(targets(target.testProvided.targetDeps)) - providedDeps.removeAll(deps) - - if (target.retrolambda) { - providedDeps.add(RetrolambdaUtil.getRtStubJarRule()) - } - - new JavaTestRule( - test(target), - ["PUBLIC"], - deps, - target.test.sources, - Collections.emptySet(), - Collections.emptySet(), - providedDeps, - target.test.resourcesDir, - target.sourceCompatibility, - target.targetCompatibility, - Collections.emptyList(), - target.test.jvmArgs, - target.testOptions, - target.getExtraOpts(RuleType.GROOVY_TEST), - RuleType.GROOVY_TEST, - Arrays.asList("unit", "groovy")) - } -} diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaBinaryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaBinaryRuleComposer.groovy index 8453905d5..8cfb32020 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaBinaryRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaBinaryRuleComposer.groovy @@ -13,8 +13,8 @@ final class JavaBinaryRuleComposer extends JvmBuckRuleComposer { } static JavaBinaryRule compose(JavaAppTarget target) { - return new JavaBinaryRule(bin(target), ["PUBLIC"], [":${src(target)}"], target.mainClass, target.excludes, - target.getExtraOpts(RuleType.JAVA_BINARY)) + return new JavaBinaryRule(bin(target), ["PUBLIC"], [":${src(target)}"], target.mainClass, + target.excludes, target.getExtraOpts(RuleType.JAVA_BINARY)) } private static String bin(final JavaTarget target) { diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaLibraryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaLibraryRuleComposer.groovy index 7d5a241cd..9cbbbced9 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaLibraryRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaLibraryRuleComposer.groovy @@ -12,7 +12,8 @@ final class JavaLibraryRuleComposer extends JvmBuckRuleComposer { // no instance } - static JavaLibraryRule compose(JavaLibTarget target) { + static JavaLibraryRule compose(JavaLibTarget target, + RuleType ruleType = RuleType.JAVA_LIBRARY) { List deps = [] deps.addAll(external(target.main.externalDeps)) deps.addAll(targets(target.main.targetDeps)) @@ -49,6 +50,6 @@ final class JavaLibraryRuleComposer extends JvmBuckRuleComposer { target.postprocessClassesCommands, target.main.jvmArgs, testTargets, - target.getExtraOpts(RuleType.JAVA_LIBRARY)) + target.getExtraOpts(ruleType)) } } diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaTestRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaTestRuleComposer.groovy index 7ee9fe69d..489566adc 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaTestRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaTestRuleComposer.groovy @@ -12,7 +12,8 @@ final class JavaTestRuleComposer extends JvmBuckRuleComposer { // no instance } - static JavaTestRule compose(JavaLibTarget target) { + static JavaTestRule compose(JavaLibTarget target, + RuleType ruleType = RuleType.JAVA_TEST) { List deps = [] deps.add(":${src(target)}") deps.addAll(external(target.test.externalDeps)) @@ -45,6 +46,6 @@ final class JavaTestRuleComposer extends JvmBuckRuleComposer { target.postprocessClassesCommands, target.test.jvmArgs, target.testOptions, - target.getExtraOpts(RuleType.JAVA_TEST)) + target.getExtraOpts(ruleType)) } } diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinLibraryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinLibraryRuleComposer.groovy deleted file mode 100644 index 98a165389..000000000 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinLibraryRuleComposer.groovy +++ /dev/null @@ -1,46 +0,0 @@ -package com.uber.okbuck.composer.kotlin - -import com.uber.okbuck.composer.jvm.JvmBuckRuleComposer -import com.uber.okbuck.core.model.base.RuleType -import com.uber.okbuck.core.model.kotlin.KotlinLibTarget -import com.uber.okbuck.rule.java.JavaLibraryRule - -final class KotlinLibraryRuleComposer extends JvmBuckRuleComposer { - - private KotlinLibraryRuleComposer() { - // no instance - } - - static JavaLibraryRule compose(KotlinLibTarget target) { - List deps = [] - deps.addAll(external(target.main.externalDeps)) - deps.addAll(targets(target.main.targetDeps)) - - Set providedDeps = [] - providedDeps.addAll(external(target.provided.externalDeps)) - providedDeps.addAll(targets(target.provided.targetDeps)) - providedDeps.removeAll(deps) - - List testTargets = [] - if (target.test.sources) { - testTargets.add(":${test(target)}") - } - - new JavaLibraryRule( - src(target), - ["PUBLIC"], - deps, - target.main.sources, - Collections.emptySet(), - Collections.emptySet(), - providedDeps, - target.main.resourcesDir, - target.sourceCompatibility, - target.targetCompatibility, - Collections.emptyList(), - target.main.jvmArgs, - testTargets, - target.getExtraOpts(RuleType.KOTLIN_LIBRARY), - RuleType.KOTLIN_LIBRARY) - } -} diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinTestRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinTestRuleComposer.groovy deleted file mode 100644 index beda79bb3..000000000 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/kotlin/KotlinTestRuleComposer.groovy +++ /dev/null @@ -1,43 +0,0 @@ -package com.uber.okbuck.composer.kotlin - -import com.uber.okbuck.composer.jvm.JvmBuckRuleComposer -import com.uber.okbuck.core.model.base.RuleType -import com.uber.okbuck.core.model.kotlin.KotlinLibTarget -import com.uber.okbuck.rule.java.JavaTestRule - -final class KotlinTestRuleComposer extends JvmBuckRuleComposer { - - private KotlinTestRuleComposer() { - // no instance - } - - static JavaTestRule compose(KotlinLibTarget target) { - List deps = [] - deps.add(":${src(target)}") - deps.addAll(external(target.test.externalDeps)) - deps.addAll(targets(target.test.targetDeps)) - - Set providedDeps = [] - providedDeps.addAll(external(target.testProvided.externalDeps)) - providedDeps.addAll(targets(target.testProvided.targetDeps)) - providedDeps.removeAll(deps) - - new JavaTestRule( - test(target), - ["PUBLIC"], - deps, - target.test.sources, - Collections.emptySet(), - Collections.emptySet(), - providedDeps, - target.test.resourcesDir, - target.sourceCompatibility, - target.targetCompatibility, - Collections.emptyList(), - target.test.jvmArgs, - target.testOptions, - target.getExtraOpts(RuleType.KOTLIN_TEST), - RuleType.KOTLIN_TEST, - Arrays.asList("unit", "kotlin")) - } -} diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy index c66aaad0d..47b62b47f 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy @@ -16,18 +16,15 @@ import com.uber.okbuck.composer.android.KeystoreRuleComposer import com.uber.okbuck.composer.android.LintRuleComposer import com.uber.okbuck.composer.android.PreBuiltNativeLibraryRuleComposer import com.uber.okbuck.composer.android.TrasformDependencyWriterRuleComposer -import com.uber.okbuck.composer.groovy.GroovyLibraryRuleComposer -import com.uber.okbuck.composer.groovy.GroovyTestRuleComposer import com.uber.okbuck.composer.java.JavaBinaryRuleComposer import com.uber.okbuck.composer.java.JavaLibraryRuleComposer import com.uber.okbuck.composer.java.JavaTestRuleComposer -import com.uber.okbuck.composer.kotlin.KotlinLibraryRuleComposer -import com.uber.okbuck.composer.kotlin.KotlinTestRuleComposer import com.uber.okbuck.config.BUCKFile import com.uber.okbuck.core.model.android.AndroidAppTarget import com.uber.okbuck.core.model.android.AndroidInstrumentationTarget import com.uber.okbuck.core.model.android.AndroidLibTarget import com.uber.okbuck.core.model.base.ProjectType +import com.uber.okbuck.core.model.base.RuleType import com.uber.okbuck.core.model.base.Target import com.uber.okbuck.core.model.groovy.GroovyLibTarget import com.uber.okbuck.core.model.java.JavaAppTarget @@ -128,20 +125,20 @@ final class BuckFileGenerator { private static List createRules(GroovyLibTarget target) { List rules = [] - rules.add(GroovyLibraryRuleComposer.compose(target)) + rules.add(JavaLibraryRuleComposer.compose(target, RuleType.GROOVY_LIBRARY)) if (target.test.sources) { - rules.add(GroovyTestRuleComposer.compose(target)) + rules.add(JavaTestRuleComposer.compose(target, RuleType.GROOVY_TEST)) } return rules } private static List createRules(KotlinLibTarget target) { List rules = [] - rules.add(KotlinLibraryRuleComposer.compose(target)) + rules.add(JavaLibraryRuleComposer.compose(target, RuleType.KOTLIN_LIBRARY)) if (target.test.sources) { - rules.add(KotlinTestRuleComposer.compose(target)) + rules.add(JavaTestRuleComposer.compose(target, RuleType.KOTLIN_TEST)) } return rules } From e461c7dc8d7b837be916863795264f182a551df6 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 22 Jun 2017 17:25:15 -0700 Subject: [PATCH 05/25] Kotlin Android Support (#458) --- .../android/AndroidLibraryRuleComposer.groovy | 1 + .../android/AndroidTestRuleComposer.groovy | 1 + ...xopackageAndroidLibraryRuleComposer.groovy | 1 + .../model/android/AndroidAppTarget.groovy | 1 - .../model/android/AndroidLibTarget.groovy | 1 - .../core/model/android/AndroidTarget.groovy | 19 +++++++++++++++++++ .../uber/okbuck/core/model/base/RuleType.java | 15 +++++++++++++++ .../rule/android/AndroidLibraryRule.groovy | 3 ++- .../rule/android/AndroidTestRule.groovy | 3 ++- .../ExopackageAndroidLibraryRule.groovy | 6 ++++-- .../com/uber/okbuck/rule/base/BuckRule.groovy | 2 +- 11 files changed, 46 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidLibraryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidLibraryRuleComposer.groovy index c52b65ca5..4c1df6762 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidLibraryRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidLibraryRuleComposer.groovy @@ -47,6 +47,7 @@ final class AndroidLibraryRuleComposer extends AndroidBuckRuleComposer { } return new AndroidLibraryRule( + target.ruleType, src(target), ["PUBLIC"], libraryDeps, diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidTestRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidTestRuleComposer.groovy index 781fcb96e..642e2147a 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidTestRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidTestRuleComposer.groovy @@ -37,6 +37,7 @@ final class AndroidTestRuleComposer extends AndroidBuckRuleComposer { } return new AndroidTestRule( + target.testRuleType, test(target), ["PUBLIC"], testDeps, diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/ExopackageAndroidLibraryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/ExopackageAndroidLibraryRuleComposer.groovy index b62e68b7b..715234e8a 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/ExopackageAndroidLibraryRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/ExopackageAndroidLibraryRuleComposer.groovy @@ -17,6 +17,7 @@ final class ExopackageAndroidLibraryRuleComposer extends AndroidBuckRuleComposer deps.add(":${buildConfig(target)}") return new ExopackageAndroidLibraryRule( + target.ruleType, appLib(target), target.exopackage.appClass, ["PUBLIC"], diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidAppTarget.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidAppTarget.groovy index 91e95dc2f..fd4d049a0 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidAppTarget.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidAppTarget.groovy @@ -3,7 +3,6 @@ package com.uber.okbuck.core.model.android import com.android.build.gradle.api.BaseVariant import com.android.builder.model.SigningConfig import com.android.manifmerger.ManifestMerger2 -import com.uber.okbuck.OkBuckGradlePlugin import com.uber.okbuck.core.model.base.Target import com.uber.okbuck.core.util.FileUtil import com.uber.okbuck.extension.TestExtension diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidLibTarget.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidLibTarget.groovy index d0fa35405..74fec9c97 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidLibTarget.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidLibTarget.groovy @@ -2,7 +2,6 @@ package com.uber.okbuck.core.model.android import com.android.build.gradle.api.BaseVariant import com.android.manifmerger.ManifestMerger2 -import groovy.util.slurpersupport.GPathResult import org.gradle.api.Project /** 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 d169ae411..0cd84994d 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 @@ -12,6 +12,7 @@ import com.android.manifmerger.ManifestMerger2 import com.android.manifmerger.MergingReport import com.android.utils.ILogger import com.uber.okbuck.OkBuckGradlePlugin +import com.uber.okbuck.core.model.base.RuleType import com.uber.okbuck.core.model.base.Scope import com.uber.okbuck.core.model.java.JavaLibTarget import com.uber.okbuck.core.model.jvm.TestOptions @@ -22,8 +23,10 @@ import org.gradle.api.JavaVersion import org.gradle.api.Project import org.gradle.api.tasks.compile.JavaCompile import org.gradle.api.tasks.testing.Test +import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper import java.nio.file.Paths + /** * An Android target */ @@ -415,6 +418,22 @@ abstract class AndroidTarget extends JavaLibTarget { return rootProject.file(Paths.get(genDir, paths).toFile()) } + RuleType getRuleType() { + if (project.plugins.hasPlugin(KotlinPluginWrapper.class)) { + return RuleType.ANDROID_LIBRARY_WITH_KOTLIN + } else { + return RuleType.ANDROID_LIBRARY + } + } + + RuleType getTestRuleType() { + if (project.plugins.hasPlugin(KotlinPluginWrapper.class)) { + return RuleType.ROBOLECTRIC_TEST_WITH_KOTLIN + } else { + return RuleType.ROBOLECTRIC_TEST + } + } + private static class EmptyLogger implements ILogger { @Override 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 7b060b9f9..13b954921 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 @@ -38,4 +38,19 @@ public enum RuleType { public List getSourceExtensions() { return sourceExtensions; } + + public String getBuckName() { + RuleType buckType = this; + switch (this) { + case ANDROID_LIBRARY_WITH_KOTLIN: + buckType = ANDROID_LIBRARY; + break; + case ROBOLECTRIC_TEST_WITH_KOTLIN: + buckType = ROBOLECTRIC_TEST; + break; + default: + break; + } + return buckType.name().toLowerCase(); + } } diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidLibraryRule.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidLibraryRule.groovy index 7804d1921..b34f8d84b 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidLibraryRule.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidLibraryRule.groovy @@ -10,6 +10,7 @@ final class AndroidLibraryRule extends AndroidRule { * @param appClass , if exopackage is enabled, pass the detected app class, otherwise, pass null * */ AndroidLibraryRule( + RuleType ruleType, String name, List visibility, List deps, @@ -29,7 +30,7 @@ final class AndroidLibraryRule extends AndroidRule { Set extraOpts) { super( - RuleType.ANDROID_LIBRARY, + ruleType, name, visibility, deps, diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidTestRule.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidTestRule.groovy index 6882a51f5..b481e913e 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidTestRule.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/AndroidTestRule.groovy @@ -8,6 +8,7 @@ final class AndroidTestRule extends AndroidRule { private static final List ANDROID_TEST_LABELS = ['unit', 'android', 'robolectric'] AndroidTestRule( + RuleType ruleType, String name, List visibility, List deps, @@ -28,7 +29,7 @@ final class AndroidTestRule extends AndroidRule { Set extraOpts) { super( - RuleType.ROBOLECTRIC_TEST, + ruleType, name, visibility, deps, diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/ExopackageAndroidLibraryRule.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/ExopackageAndroidLibraryRule.groovy index 59fcb905a..90423cbb1 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/ExopackageAndroidLibraryRule.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/rule/android/ExopackageAndroidLibraryRule.groovy @@ -11,7 +11,9 @@ final class ExopackageAndroidLibraryRule extends BuckRule { private final List mPostprocessClassesCommands private final List mOptions - ExopackageAndroidLibraryRule(String name, + ExopackageAndroidLibraryRule( + RuleType ruleType, + String name, String appClass, List visibility, List deps, @@ -20,7 +22,7 @@ final class ExopackageAndroidLibraryRule extends BuckRule { List postprocessClassesCommands, List options, Set extraOpts) { - super(RuleType.ANDROID_LIBRARY, name, visibility, deps, extraOpts) + super(ruleType, name, visibility, deps, extraOpts) mAppClass = appClass mSourceCompatibility = sourceCompatibility mTargetCompatibility = targetCompatibility diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/base/BuckRule.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/rule/base/BuckRule.groovy index c10aafa86..129fc79e7 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/base/BuckRule.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/rule/base/BuckRule.groovy @@ -13,7 +13,7 @@ abstract class BuckRule { BuckRule(RuleType ruleType, String name, List visibility = [], List deps = [], Set extraBuckOpts = []) { this.name = name - mRuleType = ruleType.name().toLowerCase() + mRuleType = ruleType.getBuckName() mVisibility = new LinkedHashSet(visibility) mDeps = new LinkedHashSet(deps) // de-dup dependencies mExtraBuckOpts = extraBuckOpts From 48aacbb6df6bb5d2fbc3a1afe07ef535cf5dfe28 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 22 Jun 2017 18:54:19 -0700 Subject: [PATCH 06/25] Add kotlin android integration test and fixup source detection (#459) * Add kotlin android integration test and fixup source detection * Add mixed sources case --- app/build.gradle | 1 + .../com/uber/okbuck/example/MainActivity.java | 18 ++++++--- .../AndroidInstrumentationTarget.groovy | 10 +---- .../core/model/android/AndroidTarget.groovy | 37 +++++++++++++------ .../okbuck/rule/android/AndroidRule.groovy | 7 ++++ libraries/kotlinandroidlibrary/build.gradle | 8 ++++ .../src/main/AndroidManifest.xml | 1 + .../main/java/com/uber/okbuck/java/Pojo.java | 3 ++ .../kotlin/com/uber/okbuck/kotlin/Data.kt | 5 +++ .../src/main/res/values/strings.xml | 4 ++ settings.gradle | 1 + 11 files changed, 70 insertions(+), 25 deletions(-) create mode 100755 libraries/kotlinandroidlibrary/build.gradle create mode 100755 libraries/kotlinandroidlibrary/src/main/AndroidManifest.xml create mode 100644 libraries/kotlinandroidlibrary/src/main/java/com/uber/okbuck/java/Pojo.java create mode 100755 libraries/kotlinandroidlibrary/src/main/kotlin/com/uber/okbuck/kotlin/Data.kt create mode 100755 libraries/kotlinandroidlibrary/src/main/res/values/strings.xml diff --git a/app/build.gradle b/app/build.gradle index 6dcf10538..e3fbe4849 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -63,6 +63,7 @@ dependencies { compile deps.apt.autoValue compile project(':libraries:emptylibrary') + compile project(':libraries:kotlinandroidlibrary') devCompile project(path: ':dummylibrary', configuration: 'freeRelease') prodCompile project(path: ':dummylibrary', configuration: 'paidRelease') demoCompile project(path: ':dummylibrary', configuration: 'paidRelease') diff --git a/app/src/main/java/com/uber/okbuck/example/MainActivity.java b/app/src/main/java/com/uber/okbuck/example/MainActivity.java index 28af0eb3f..69ed95846 100644 --- a/app/src/main/java/com/uber/okbuck/example/MainActivity.java +++ b/app/src/main/java/com/uber/okbuck/example/MainActivity.java @@ -9,20 +9,25 @@ import android.util.Log; import android.widget.TextView; import android.widget.Toast; -import butterknife.BindView; -import butterknife.ButterKnife; -import butterknife.Unbinder; + +import com.github.piasy.rxscreenshotdetector.RxScreenshotDetector; +import com.promegu.xlog.base.XLog; import com.uber.okbuck.example.common.Calc; import com.uber.okbuck.example.common.CalcMonitor; import com.uber.okbuck.example.common.IMyAidlInterface; import com.uber.okbuck.example.dummylibrary.DummyActivity; import com.uber.okbuck.example.dummylibrary.DummyAndroidClass; import com.uber.okbuck.example.javalib.DummyJavaClass; -import com.github.piasy.rxscreenshotdetector.RxScreenshotDetector; import com.uber.okbuck.example.sqldelightmodel.GithubRepo; import com.uber.okbuck.example.sqldelightmodel.GithubUser; -import com.promegu.xlog.base.XLog; +import com.uber.okbuck.java.Pojo; +import com.uber.okbuck.kotlin.KotlinDataClass; + import javax.inject.Inject; + +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.Unbinder; import rx.Subscriber; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; @@ -98,6 +103,9 @@ public void onNext(String path) { Toast.makeText(this, user.login(), Toast.LENGTH_SHORT).show(); GithubRepo repo = GithubRepo.create(100, "OkBuck", "auto buck"); Toast.makeText(this, repo.name() + ": " + repo.description(), Toast.LENGTH_SHORT).show(); + + KotlinDataClass data = new KotlinDataClass("foo", R.string.foo); + Pojo pojo = new Pojo(); } @Override diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidInstrumentationTarget.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidInstrumentationTarget.groovy index f4a3df6c8..215b84334 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidInstrumentationTarget.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidInstrumentationTarget.groovy @@ -3,10 +3,8 @@ package com.uber.okbuck.core.model.android import com.android.build.gradle.api.ApplicationVariant import com.android.build.gradle.api.BaseVariant import com.android.builder.core.VariantType -import com.android.builder.model.SourceProvider import com.uber.okbuck.core.model.base.Scope import org.gradle.api.Project - /** * An Android instrumentation target */ @@ -40,9 +38,7 @@ class AndroidInstrumentationTarget extends AndroidAppTarget { return new Scope( project, expand(compileConfigs, ANDROID_TEST_PREFIX, true), - baseVariant.sourceSets.collect { SourceProvider provider -> - provider.javaDirectories - }.flatten() as Set, + getSources(baseVariant), null, getJavaCompilerOptions(baseVariant)) } @@ -57,9 +53,7 @@ class AndroidInstrumentationTarget extends AndroidAppTarget { project, expand(compileConfigs, ANDROID_TEST_PREFIX) + ["androidTest${getMainTargetName(name).capitalize()}Compile"], - baseVariant.sourceSets.collect { SourceProvider provider -> - provider.javaDirectories - }.flatten() as Set, + getSources(baseVariant), null, getJavaCompilerOptions(instrumentationTestVariant)) } 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 0cd84994d..630d8bec5 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 @@ -23,10 +23,9 @@ import org.gradle.api.JavaVersion import org.gradle.api.Project import org.gradle.api.tasks.compile.JavaCompile import org.gradle.api.tasks.testing.Test -import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper +import org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPluginWrapper import java.nio.file.Paths - /** * An Android target */ @@ -45,6 +44,7 @@ abstract class AndroidTarget extends JavaLibTarget { final boolean debuggable final boolean generateR2 final String genDir + final boolean isKotlin private String manifestPath private String packageName @@ -91,6 +91,9 @@ abstract class AndroidTarget extends JavaLibTarget { genDir = Paths.get(OkBuckGradlePlugin.OKBUCK_GEN, path, name).toString() FileUtil.copyResourceToProject("gen/BUCK_FILE", new File(rootProject.file(genDir), OkBuckGradlePlugin.BUCK)) + + // Check if kotlin + isKotlin = project.plugins.hasPlugin(KotlinAndroidPluginWrapper.class) } protected abstract BaseVariant getBaseVariant() @@ -104,14 +107,10 @@ abstract class AndroidTarget extends JavaLibTarget { @Override Scope getMain() { - Set srcDirs = baseVariant.sourceSets.collect { SourceProvider provider -> - provider.javaDirectories - }.flatten() as Set - return new Scope( project, expand(compileConfigs), - srcDirs, + getSources(baseVariant), null, getJavaCompilerOptions(baseVariant)) } @@ -120,9 +119,7 @@ abstract class AndroidTarget extends JavaLibTarget { Scope getTest() { Set testSrcDirs = [] as Set if (unitTestVariant) { - testSrcDirs.addAll(unitTestVariant.sourceSets.collect { SourceProvider provider -> - provider.javaDirectories - }.flatten() as Set) + testSrcDirs = getSources(unitTestVariant) } return new Scope( @@ -419,7 +416,7 @@ abstract class AndroidTarget extends JavaLibTarget { } RuleType getRuleType() { - if (project.plugins.hasPlugin(KotlinPluginWrapper.class)) { + if (isKotlin) { return RuleType.ANDROID_LIBRARY_WITH_KOTLIN } else { return RuleType.ANDROID_LIBRARY @@ -427,13 +424,29 @@ abstract class AndroidTarget extends JavaLibTarget { } RuleType getTestRuleType() { - if (project.plugins.hasPlugin(KotlinPluginWrapper.class)) { + if (isKotlin) { return RuleType.ROBOLECTRIC_TEST_WITH_KOTLIN } else { return RuleType.ROBOLECTRIC_TEST } } + Set getSources(BaseVariant variant) { + Set srcs = new HashSet<>() + srcs.addAll(variant.sourceSets.collect { SourceProvider provider -> + provider.javaDirectories + }.flatten() as Set) + + if (isKotlin) { + srcs += srcs.findAll { + it.name == "java" + }.collect { + new File(it.absolutePath.replaceFirst("/java\$", "/kotlin")) + } + } + return srcs + } + private static class EmptyLogger implements ILogger { @Override 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 bdc77d242..17121c08c 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 @@ -7,6 +7,7 @@ import org.apache.commons.lang.StringUtils abstract class AndroidRule extends JavaRule { + private final RuleType mRuleType private final String mManifest private final String mRobolectricManifest private final List mAidlRuleNames @@ -43,6 +44,7 @@ abstract class AndroidRule extends JavaRule { !StringUtils.isEmpty(appClass) ? Collections.singleton(appClass) : Collections.emptySet()) + mRuleType = ruleType mManifest = manifest mRobolectricManifest = robolectricManifest mAidlRuleNames = aidlRuleNames @@ -54,6 +56,11 @@ 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) { + printer.println("\tlanguage = 'kotlin',") + } + if (!StringUtils.isEmpty(mManifest)) { printer.println("\tmanifest = '${mManifest}',") } diff --git a/libraries/kotlinandroidlibrary/build.gradle b/libraries/kotlinandroidlibrary/build.gradle new file mode 100755 index 000000000..d0f0cd1f9 --- /dev/null +++ b/libraries/kotlinandroidlibrary/build.gradle @@ -0,0 +1,8 @@ +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +dependencies { + compile deps.external.kotlinStdlib + testCompile deps.test.junit + testCompile deps.test.kotlinTest +} diff --git a/libraries/kotlinandroidlibrary/src/main/AndroidManifest.xml b/libraries/kotlinandroidlibrary/src/main/AndroidManifest.xml new file mode 100755 index 000000000..24a4abdbd --- /dev/null +++ b/libraries/kotlinandroidlibrary/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + diff --git a/libraries/kotlinandroidlibrary/src/main/java/com/uber/okbuck/java/Pojo.java b/libraries/kotlinandroidlibrary/src/main/java/com/uber/okbuck/java/Pojo.java new file mode 100644 index 000000000..6a6b14e33 --- /dev/null +++ b/libraries/kotlinandroidlibrary/src/main/java/com/uber/okbuck/java/Pojo.java @@ -0,0 +1,3 @@ +package com.uber.okbuck.java; + +public class Pojo {} diff --git a/libraries/kotlinandroidlibrary/src/main/kotlin/com/uber/okbuck/kotlin/Data.kt b/libraries/kotlinandroidlibrary/src/main/kotlin/com/uber/okbuck/kotlin/Data.kt new file mode 100755 index 000000000..5d87455d7 --- /dev/null +++ b/libraries/kotlinandroidlibrary/src/main/kotlin/com/uber/okbuck/kotlin/Data.kt @@ -0,0 +1,5 @@ +package com.uber.okbuck.kotlin + +import com.uber.okbuck.kotlin.android.R + +data class KotlinDataClass(val string : String, val id : Int = R.string.foo) diff --git a/libraries/kotlinandroidlibrary/src/main/res/values/strings.xml b/libraries/kotlinandroidlibrary/src/main/res/values/strings.xml new file mode 100755 index 000000000..0a566fd2f --- /dev/null +++ b/libraries/kotlinandroidlibrary/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + bar + diff --git a/settings.gradle b/settings.gradle index 373b5dfa4..938666bd9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,6 +6,7 @@ include 'libraries:customLintLibrary' include 'libraries:emptylibrary' include 'libraries:groovylibrary' include 'libraries:javalibrary' +include 'libraries:kotlinandroidlibrary' include 'libraries:kotlinlibrary' include 'libraries:lintErrorLibrary' include 'libraries:parcelable' From 78a7ee7c656e30cbf36b9d2f4b1ecb047102e443 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 22 Jun 2017 19:35:45 -0700 Subject: [PATCH 07/25] Update kotlin, gradle and buck versions (#460) --- .buckversion | 2 +- build.gradle | 6 ++-- buildSrc/build.gradle | 1 + .../core/model/android/AndroidTarget.groovy | 4 +-- .../uber/okbuck/core/model/base/RuleType.java | 14 ++++---- .../okbuck/rule/android/AndroidRule.groovy | 4 +-- .../com/uber/okbuck/core/util/KotlinUtil.java | 34 +++++++++--------- dependencies.gradle | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 54711 -> 54706 bytes gradle/wrapper/gradle-wrapper.properties | 4 +-- 10 files changed, 35 insertions(+), 36 deletions(-) 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 09f9eaa8e959ff13b3ba7b6b02ec1d50eb39e091..7ae994dbb52f247b1eed09f05b4eb774766bb623 100644 GIT binary patch delta 63 zcmdnKnt9V|<_+%-Gv`ddHu>XWD}Dxs0B?4VJF~w_2{SM-2yV7Nq9Mo&l=OlNO)j}= L%Vv87D9Zo Date: Thu, 22 Jun 2017 19:41:36 -0700 Subject: [PATCH 08/25] Publish v0.22.0 --- README-zh.md | 2 +- README.md | 2 +- buildSrc/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README-zh.md b/README-zh.md index 0ffcbc46b..6bee3222a 100644 --- a/README-zh.md +++ b/README-zh.md @@ -9,7 +9,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.21.0' + classpath 'com.uber:okbuck:0.22.0' } } diff --git a/README.md b/README.md index 33c3e4a19..27c9be3f9 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.21.0' + classpath 'com.uber:okbuck:0.22.0' } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 5eca91e37..fbf14121f 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -48,7 +48,7 @@ task sourcesJar(type: Jar) { classifier = 'sources' } -def publishVersion = '0.21.0' +def publishVersion = '0.22.0' group = 'com.uber' version = publishVersion def siteUrl = 'https://github.com/uber/okbuck' From 04a7a28b1e26bbe0788d72a16ae838afdd52ea4d Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 22 Jun 2017 20:15:06 -0700 Subject: [PATCH 09/25] Fix rule type propagation --- .../uber/okbuck/composer/java/JavaLibraryRuleComposer.groovy | 1 + .../com/uber/okbuck/composer/java/JavaTestRuleComposer.groovy | 1 + .../groovy/com/uber/okbuck/rule/java/JavaLibraryRule.groovy | 4 ++-- .../main/groovy/com/uber/okbuck/rule/java/JavaTestRule.groovy | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaLibraryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaLibraryRuleComposer.groovy index 9cbbbced9..2c12553b0 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaLibraryRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaLibraryRuleComposer.groovy @@ -37,6 +37,7 @@ final class JavaLibraryRuleComposer extends JvmBuckRuleComposer { } new JavaLibraryRule( + ruleType, src(target), ["PUBLIC"], deps, diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaTestRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaTestRuleComposer.groovy index 489566adc..8e7fa40bd 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaTestRuleComposer.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/composer/java/JavaTestRuleComposer.groovy @@ -33,6 +33,7 @@ final class JavaTestRuleComposer extends JvmBuckRuleComposer { } new JavaTestRule( + ruleType, test(target), ["PUBLIC"], deps, diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaLibraryRule.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaLibraryRule.groovy index dfd200691..8e38174a8 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaLibraryRule.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaLibraryRule.groovy @@ -6,6 +6,7 @@ import com.uber.okbuck.core.model.jvm.TestOptions class JavaLibraryRule extends JavaRule { JavaLibraryRule( + RuleType ruleType, String name, List visibility, List deps, @@ -19,8 +20,7 @@ class JavaLibraryRule extends JavaRule { List postprocessClassesCommands, List options, List testTargets, - Set extraOpts, - RuleType ruleType = RuleType.JAVA_LIBRARY) { + Set extraOpts) { super( ruleType, diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaTestRule.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaTestRule.groovy index c6e105144..7ed8ce46e 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaTestRule.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/rule/java/JavaTestRule.groovy @@ -8,6 +8,7 @@ class JavaTestRule extends JavaRule { private static final List JAVA_TEST_LABELS = ['unit', 'java'] JavaTestRule( + RuleType ruleType, String name, List visibility, List deps, @@ -22,7 +23,6 @@ class JavaTestRule extends JavaRule { List options, TestOptions testOptions, Set extraOpts, - RuleType ruleType = RuleType.JAVA_TEST, List testLabels = JAVA_TEST_LABELS) { super( ruleType, From 3950284277308b00be997c18e9408c45f83855f2 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 22 Jun 2017 20:15:45 -0700 Subject: [PATCH 10/25] Publish v0.22.1 --- README-zh.md | 2 +- README.md | 2 +- buildSrc/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README-zh.md b/README-zh.md index 6bee3222a..966434ecd 100644 --- a/README-zh.md +++ b/README-zh.md @@ -9,7 +9,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.22.0' + classpath 'com.uber:okbuck:0.22.1' } } diff --git a/README.md b/README.md index 27c9be3f9..0a60e0198 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.22.0' + classpath 'com.uber:okbuck:0.22.1' } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index fbf14121f..d0d057978 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -48,7 +48,7 @@ task sourcesJar(type: Jar) { classifier = 'sources' } -def publishVersion = '0.22.0' +def publishVersion = '0.22.1' group = 'com.uber' version = publishVersion def siteUrl = 'https://github.com/uber/okbuck' From bf291799228609d1cb332321a38660164a901f8c Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 23 Jun 2017 09:53:19 -0500 Subject: [PATCH 11/25] Add support for mixed kotlin and java in regular kotlin modules. (#461) --- .../com/uber/okbuck/core/model/base/RuleType.java | 4 ++-- .../kotlinlibrary/src/main/java/demo/JavaClass.java | 12 ++++++++++++ .../src/main/{kotlin => java}/demo/helloWorld.kt | 1 + .../test/{kotlin => java}/demo/HelloWorldTest.kt | 3 +++ .../src/test/java/demo/JavaClassTest.java | 13 +++++++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 libraries/kotlinlibrary/src/main/java/demo/JavaClass.java rename libraries/kotlinlibrary/src/main/{kotlin => java}/demo/helloWorld.kt (89%) rename libraries/kotlinlibrary/src/test/{kotlin => java}/demo/HelloWorldTest.kt (63%) create mode 100644 libraries/kotlinlibrary/src/test/java/demo/JavaClassTest.java 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 4451c0273..03f3e0510 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 @@ -19,9 +19,9 @@ public enum RuleType { JAVA_LIBRARY, JAVA_TEST, KOTLIN_ANDROID_LIBRARY("java", "kt"), - KOTLIN_LIBRARY("kt"), + KOTLIN_LIBRARY("java", "kt"), KOTLIN_ROBOLECTRIC_TEST("java", "kt"), - KOTLIN_TEST("kt"), + KOTLIN_TEST("java", "kt"), PREBUILT_NATIVE_LIBRARY, ROBOLECTRIC_TEST; diff --git a/libraries/kotlinlibrary/src/main/java/demo/JavaClass.java b/libraries/kotlinlibrary/src/main/java/demo/JavaClass.java new file mode 100644 index 000000000..16bd9cecf --- /dev/null +++ b/libraries/kotlinlibrary/src/main/java/demo/JavaClass.java @@ -0,0 +1,12 @@ +package demo; + +public class JavaClass { + + public String getFoo() { + return "foo"; + } + + public String getKotlinGreeting() { + return HelloWorldKt.getGreeting(); + } +} diff --git a/libraries/kotlinlibrary/src/main/kotlin/demo/helloWorld.kt b/libraries/kotlinlibrary/src/main/java/demo/helloWorld.kt similarity index 89% rename from libraries/kotlinlibrary/src/main/kotlin/demo/helloWorld.kt rename to libraries/kotlinlibrary/src/main/java/demo/helloWorld.kt index e4f2c55d9..580d0b472 100644 --- a/libraries/kotlinlibrary/src/main/kotlin/demo/helloWorld.kt +++ b/libraries/kotlinlibrary/src/main/java/demo/helloWorld.kt @@ -10,4 +10,5 @@ fun getGreeting(): String { fun main(args: Array) { println(getGreeting()) + println(JavaClass().foo) } diff --git a/libraries/kotlinlibrary/src/test/kotlin/demo/HelloWorldTest.kt b/libraries/kotlinlibrary/src/test/java/demo/HelloWorldTest.kt similarity index 63% rename from libraries/kotlinlibrary/src/test/kotlin/demo/HelloWorldTest.kt rename to libraries/kotlinlibrary/src/test/java/demo/HelloWorldTest.kt index bd6c96d5c..03d68b1c6 100644 --- a/libraries/kotlinlibrary/src/test/kotlin/demo/HelloWorldTest.kt +++ b/libraries/kotlinlibrary/src/test/java/demo/HelloWorldTest.kt @@ -7,4 +7,7 @@ class HelloWorldTest { @Test fun f() { assertEquals("Hello, world!", getGreeting()) } + @Test fun fooVoid() { + assertEquals("Hello, world!", JavaClass().kotlinGreeting) + } } diff --git a/libraries/kotlinlibrary/src/test/java/demo/JavaClassTest.java b/libraries/kotlinlibrary/src/test/java/demo/JavaClassTest.java new file mode 100644 index 000000000..31229db97 --- /dev/null +++ b/libraries/kotlinlibrary/src/test/java/demo/JavaClassTest.java @@ -0,0 +1,13 @@ +package demo; + +import org.junit.Test; + +import static kotlin.test.AssertionsKt.assertEquals; + +public class JavaClassTest { + + @Test public void testGetGreetingJava() { + assertEquals(HelloWorldKt.getGreeting(), new JavaClass().getKotlinGreeting(), + "Java and kotlin greeting should be the same"); + } +} From 8d7d8c6eda78fa61c35e5bdf85b0033042dec803 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Fri, 23 Jun 2017 10:54:02 -0700 Subject: [PATCH 12/25] Remove kotlin-dev repo as 1.1.3 is now released --- build.gradle | 2 -- buildSrc/build.gradle | 1 - 2 files changed, 3 deletions(-) diff --git a/build.gradle b/build.gradle index 461f4cddf..bab72c700 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,6 @@ buildscript { jcenter() google() maven { url "https://plugins.gradle.org/m2/" } - maven { url "https://dl.bintray.com/kotlin/kotlin-dev/"} } dependencies { classpath deps.build.androidPlugin @@ -21,7 +20,6 @@ allprojects { project -> repositories { jcenter() google() - maven { url "https://dl.bintray.com/kotlin/kotlin-dev/"} } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index d0d057978..cf1de34b1 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -9,7 +9,6 @@ apply from: "../dependencies.gradle" repositories { jcenter() google() - maven { url "https://dl.bintray.com/kotlin/kotlin-dev/"} } tasks.withType(GroovyCompile) { From 9204b5702973271af74fa604d664089f5dd138f5 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Sun, 25 Jun 2017 21:45:43 -0700 Subject: [PATCH 13/25] Update several dependencies to latest (#462) --- .buckversion | 2 +- .travis.yml | 4 +-- app/aars/rxscreenshotdetector-release.aar | Bin 8966 -> 7023 bytes .../com/uber/okbuck/example/MainActivity.java | 18 ++++++---- .../okbuck/rule/android/AndroidRule.groovy | 1 + dependencies.gradle | 34 +++++++++--------- libraries/emptylibrary/build.gradle | 2 +- .../example/empty/EmptyLibraryUnitTest.java | 13 ++----- libraries/lintErrorLibrary/build.gradle | 3 -- settings.gradle | 1 - 10 files changed, 37 insertions(+), 41 deletions(-) diff --git a/.buckversion b/.buckversion index f6b2ac1df..154c1b4f5 100644 --- a/.buckversion +++ b/.buckversion @@ -1 +1 @@ -cf0c82541709e2c6f77d7a6062097242a5ea7874 +bd7dec472d385279ea961789eaf72bc655ca9213 diff --git a/.travis.yml b/.travis.yml index dfff3dc59..1bef079db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ android: - tools - platform-tools - tools - - build-tools-25.0.1 - - android-25 + - build-tools-26.0.0 + - android-26 - extra-android-m2repository before_script: diff --git a/app/aars/rxscreenshotdetector-release.aar b/app/aars/rxscreenshotdetector-release.aar index 2bf3e7190504e9b8c1ab3a43f866d3e97e517ed2..37395fbe68758fa543b9cee2d3672abc395f074c 100644 GIT binary patch literal 7023 zcmaKxWmsIzmW3N9!GpU52@oU@oW_D%;}9$mv>~`#L$Ki9I0Pp+H16*1?k>UIGReI& z^L_U|cV?gGRQ)*X-Bq>zomxtA2#7BM08~^!ShI>O?i*^aGXMY(4+j9?{+>mxjqPo~ z#tMekU{ezZM^;y>FIG_?xlR%6?vp#b!Ij1$q+EYmI`dN+{0W+sfd&DE_&V>odFiKX zdayP#e{IrTb8l1sjMRmw5Osz#cYf_r;H&ZpMyr(6>$7sLai?fwNi8oxm~k6RUPs|t z)c}|@8^k9y?~Bv7!xuYZyDmThxD(8NK|FvqAB=3zk6k=o@pCn47QR)BHwzs=phJi+ z9yJ~iYsxLX%S@R{a#`fli zp0W2(mk0p>UNQgx?YBclUkn`_OdMD(4DFkf%#_r08UjfXzr>)zzmlNcHHgKb&Cioa zPIZV-unETjeg6=H74F4;}As^LmOfY*DqbC?Q)<$y2Q_^dLuuqE$m!!Wz=l* z)7`@R0EGFhena(vH`qTIGP67Z@0zsln%W$%52E;aXmu2q=m{R_ z0!xa4B`iQaLr<9gwW5Z7DJ%DNO;fz$4h6-6c9%~|>vyMVEC6lS4`7m){Ik7(z{fTU zin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index 69ed95846..ea280b798 100644 --- a/app/src/main/java/com/uber/okbuck/example/MainActivity.java +++ b/app/src/main/java/com/uber/okbuck/example/MainActivity.java @@ -28,9 +28,10 @@ import butterknife.BindView; import butterknife.ButterKnife; import butterknife.Unbinder; -import rx.Subscriber; -import rx.android.schedulers.AndroidSchedulers; -import rx.schedulers.Schedulers; +import io.reactivex.Observer; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.disposables.Disposable; +import io.reactivex.schedulers.Schedulers; @XLog public class MainActivity extends AppCompatActivity { @@ -80,12 +81,12 @@ protected void onCreate(Bundle savedInstanceState) { Log.d("test", "1 + 2 = " + new Calc(new CalcMonitor(this)).add(1, 2)); - RxScreenshotDetector.start(getApplicationContext()) + RxScreenshotDetector.start(this) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new Subscriber() { + .subscribe(new Observer() { @Override - public void onCompleted() { + public void onComplete() { } @@ -98,6 +99,11 @@ public void onError(Throwable e) { public void onNext(String path) { mTextView.setText(mTextView.getText() + "\nScreenshot: " + path); } + + @Override + public void onSubscribe(Disposable disposable) { + + } }); GithubUser user = GithubUser.create(100, "OkBuck"); Toast.makeText(this, user.login(), Toast.LENGTH_SHORT).show(); 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 d036ef751..ac42b3d6a 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 @@ -82,6 +82,7 @@ abstract class AndroidRule extends JavaRule { } if (mRuntimeDependency) { + printer.println("\tforce_final_resource_ids = False,") printer.println("\trobolectric_runtime_dependency = '${mRuntimeDependency}',") } } diff --git a/dependencies.gradle b/dependencies.gradle index 1207c4bb3..2232db91b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,9 +1,9 @@ def versions = [ - butterKnifeVersion : '8.4.0', - daggerVersion : '2.8', + butterKnifeVersion : '8.6.0', + daggerVersion : '2.11', kotlinVersion : '1.1.3', - leakCanaryVersion : '1.5', - supportVersion : '25.0.1', + leakCanaryVersion : '1.5.1', + supportVersion : '26.0.0-beta2', androidPluginVersion : '2.3.2', ] @@ -15,16 +15,16 @@ def build = [ commonsLang : 'commons-lang:commons-lang:2.6', kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlinVersion}", mavenArtifact : 'org.apache.maven:maven-artifact:3.3.9', - retrolambdaPlugin: 'me.tatarka:gradle-retrolambda:3.5.0', - sqlDelightPlugin : 'com.squareup.sqldelight:gradle-plugin:0.5.1', - shadowJar : "com.github.jengelman.gradle.plugins:shadow:1.2.4", + retrolambdaPlugin: 'me.tatarka:gradle-retrolambda:3.6.1', + sqlDelightPlugin : 'com.squareup.sqldelight:gradle-plugin:0.6.1', + shadowJar : "com.github.jengelman.gradle.plugins:shadow:2.0.1", ] def buildConfig = [ - compileSdk: 25, - buildTools: '25.0.1', + compileSdk: 26, + buildTools: '26.0.0', minSdk : 16, - targetSdk : 25, + targetSdk : 26, ] def apt = [ @@ -38,13 +38,13 @@ def apt = [ def external = [ butterKnife : "com.jakewharton:butterknife:${versions.butterKnifeVersion}", dagger : "com.google.dagger:dagger:${versions.daggerVersion}", - gson : 'com.google.code.gson:gson:2.8.0', + gson : 'com.google.code.gson:gson:2.8.1', kotlinStdlib : "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlinVersion}", leakCanary : "com.squareup.leakcanary:leakcanary-android:${versions.leakCanaryVersion}", - rxandroid : 'io.reactivex:rxandroid:1.2.1', - rxjava : 'io.reactivex:rxjava:1.1.8', - rxPermissions : 'com.tbruyelle.rxpermissions:rxpermissions:0.5.2', - sqlite : 'com.pushtorefresh.storio:sqlite:1.11.0', + rxandroid : 'io.reactivex.rxjava2:rxandroid:2.0.1', + rxjava : 'io.reactivex.rxjava2:rxjava:2.1.1', + rxPermissions : 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4', + sqlite : 'com.pushtorefresh.storio:sqlite:1.13.0', xlogAndroidIdle: 'com.github.promeg:xlog-android-idle:2.1.1', ] @@ -70,8 +70,8 @@ def test = [ junit : 'junit:junit:4.12', kotlinTest : "org.jetbrains.kotlin:kotlin-test-junit:${versions.kotlinVersion}", mockito : 'org.mockito:mockito-core:1.10.19', - robolectric : 'org.robolectric:robolectric:3.0', - assertj : 'org.assertj:assertj-core:3.6.1' + robolectric : 'org.robolectric:robolectric:3.4-rc2', + assertj : 'org.assertj:assertj-core:3.8.0' ] ext.config = [ diff --git a/libraries/emptylibrary/build.gradle b/libraries/emptylibrary/build.gradle index 1dca60cca..d048e61f9 100644 --- a/libraries/emptylibrary/build.gradle +++ b/libraries/emptylibrary/build.gradle @@ -12,5 +12,5 @@ dependencies { buckLintLibrary deps.support.appCompat testCompile deps.test.junit - testCompile project(':libraries:robolectric-base') + testCompile deps.test.robolectric } diff --git a/libraries/emptylibrary/src/test/java/com/uber/okbuck/example/empty/EmptyLibraryUnitTest.java b/libraries/emptylibrary/src/test/java/com/uber/okbuck/example/empty/EmptyLibraryUnitTest.java index 1bb368359..b39597744 100644 --- a/libraries/emptylibrary/src/test/java/com/uber/okbuck/example/empty/EmptyLibraryUnitTest.java +++ b/libraries/emptylibrary/src/test/java/com/uber/okbuck/example/empty/EmptyLibraryUnitTest.java @@ -1,20 +1,14 @@ package com.uber.okbuck.example.empty; -import android.content.Context; - -import com.uber.okbuck.BuckRobolectricTestRunner; - import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; -import java.io.*; - import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -@RunWith(BuckRobolectricTestRunner.class) +@RunWith(RobolectricTestRunner.class) @Config(sdk = 21, packageName = "com.uber.okbuck.example.empty") public class EmptyLibraryUnitTest { @@ -25,7 +19,6 @@ public void addition_isCorrect() throws Exception { @Test public void resource_loading() { - Context context = (Context) RuntimeEnvironment.application; - assertEquals(context.getResources().getString(R.string.empty_release_string), "empty_release_string"); + assertEquals(RuntimeEnvironment.application.getResources().getString(R.string.empty_release_string), "empty_release_string"); } } diff --git a/libraries/lintErrorLibrary/build.gradle b/libraries/lintErrorLibrary/build.gradle index 14e19a425..a4c683ec8 100644 --- a/libraries/lintErrorLibrary/build.gradle +++ b/libraries/lintErrorLibrary/build.gradle @@ -4,7 +4,4 @@ apply plugin: 'me.tatarka.retrolambda' dependencies { buckLint project (':libraries:customLintLibrary') compile deps.support.appCompat - - testCompile deps.test.junit - testCompile project(':libraries:robolectric-base') } diff --git a/settings.gradle b/settings.gradle index 938666bd9..851583cd4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,6 +10,5 @@ include 'libraries:kotlinandroidlibrary' include 'libraries:kotlinlibrary' include 'libraries:lintErrorLibrary' include 'libraries:parcelable' -include 'libraries:robolectric-base' include 'plugin' include 'transform-cli' From 2ab6cf406d9c7309d0574bb99cd708d1e015c343 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 27 Jun 2017 15:11:20 -0700 Subject: [PATCH 14/25] Setup Kotlin home whenever the kotlin gradle plugin is on the classpath. (#464) Previously we should only check if a module was a kotlin module which didn't account for kotlin-android modules. --- .../src/main/java/com/uber/okbuck/core/task/OkBuckTask.java | 3 +-- .../src/main/java/com/uber/okbuck/core/util/KotlinUtil.java | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/java/com/uber/okbuck/core/task/OkBuckTask.java b/buildSrc/src/main/java/com/uber/okbuck/core/task/OkBuckTask.java index a0cc17304..82568001d 100644 --- a/buildSrc/src/main/java/com/uber/okbuck/core/task/OkBuckTask.java +++ b/buildSrc/src/main/java/com/uber/okbuck/core/task/OkBuckTask.java @@ -13,7 +13,6 @@ import com.uber.okbuck.extension.OkBuckExtension; import com.uber.okbuck.generator.DotBuckConfigLocalGenerator; -import org.apache.commons.lang3.tuple.Pair; import org.gradle.api.DefaultTask; import org.gradle.api.specs.Specs; import org.gradle.api.tasks.Nested; @@ -46,7 +45,7 @@ void okbuck() { } // Fetch Kotlin support deps if needed - boolean hasKotlinLib = okBuckExtension.buckProjects.parallelStream().anyMatch(project -> ProjectUtil.getType(project) == ProjectType.KOTLIN_LIB); + boolean hasKotlinLib = KotlinUtil.hasKotlinPluginInClasspath(getProject()); if (hasKotlinLib) { KotlinUtil.setupKotlinHome(getProject()); } 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 5e112b053..cf5314aee 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 @@ -62,4 +62,8 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws }); } catch (IOException ignored) {} } + + public static boolean hasKotlinPluginInClasspath(Project project) { + return ProjectUtil.findVersionInClasspath(project, KOTLIN_GROUP, KOTLIN_GRADLE_MODULE) != null; + } } From 2daa553db25139a69fdd1f4119207c0f519a861c Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Tue, 27 Jun 2017 17:50:44 -0700 Subject: [PATCH 15/25] Do not generate default project ignores Fixes: https://github.com/facebook/buck/issues/1402 Let the user configure the ignores instead in .buckconfig --- .../com/uber/okbuck/config/DotBuckConfigLocalFile.java | 7 ------- .../okbuck/generator/DotBuckConfigLocalGenerator.groovy | 1 - 2 files changed, 8 deletions(-) diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/config/DotBuckConfigLocalFile.java b/buildSrc/src/main/groovy/com/uber/okbuck/config/DotBuckConfigLocalFile.java index cabb97a50..b5dc491ce 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/config/DotBuckConfigLocalFile.java +++ b/buildSrc/src/main/groovy/com/uber/okbuck/config/DotBuckConfigLocalFile.java @@ -12,7 +12,6 @@ public final class DotBuckConfigLocalFile extends BuckConfigFile { private final Map aliases; private final String buildToolVersion; private final String target; - private final List ignore; private final String groovyHome; private final String kotlinHome; private final String proguardJar; @@ -22,7 +21,6 @@ public DotBuckConfigLocalFile( Map aliases, String buildToolVersion, String target, - List ignore, String groovyHome, String kotlinHome, String proguardJar, @@ -30,7 +28,6 @@ public DotBuckConfigLocalFile( this.aliases = aliases; this.buildToolVersion = buildToolVersion; this.target = target; - this.ignore = ignore; this.groovyHome = groovyHome; this.kotlinHome = kotlinHome; this.proguardJar = proguardJar; @@ -48,10 +45,6 @@ public final void print(PrintStream printer) { printer.println("\ttarget = " + target); printer.println(); - printer.println("[project]"); - printer.println("\tignore = " + String.join(", ", ignore)); - printer.println(); - if (!defs.isEmpty()) { printer.println("[buildfile]"); printer.println("\tincludes = " + String.join(" ", defs)); diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/generator/DotBuckConfigLocalGenerator.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/generator/DotBuckConfigLocalGenerator.groovy index 2eeae7c4f..37b8cb0ab 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/generator/DotBuckConfigLocalGenerator.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/generator/DotBuckConfigLocalGenerator.groovy @@ -34,7 +34,6 @@ final class DotBuckConfigLocalGenerator { return new DotBuckConfigLocalFile(aliases, okbuck.buildToolVersion, okbuck.target, - [".git", "**/.svn"], groovyHome, kotlinHome, proguardJar, From 8618cdbd6533d93f9855d606e487c43ff7652266 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Tue, 27 Jun 2017 17:52:33 -0700 Subject: [PATCH 16/25] Publish v0.22.2 --- README-zh.md | 2 +- README.md | 2 +- buildSrc/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README-zh.md b/README-zh.md index 966434ecd..661bf82b8 100644 --- a/README-zh.md +++ b/README-zh.md @@ -9,7 +9,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.22.1' + classpath 'com.uber:okbuck:0.22.2' } } diff --git a/README.md b/README.md index 0a60e0198..afbe367c1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.22.1' + classpath 'com.uber:okbuck:0.22.2' } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index cf1de34b1..e7fe38d31 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -47,7 +47,7 @@ task sourcesJar(type: Jar) { classifier = 'sources' } -def publishVersion = '0.22.1' +def publishVersion = '0.22.2' group = 'com.uber' version = publishVersion def siteUrl = 'https://github.com/uber/okbuck' From 44589232e04bfdf2a37da1678feb2354f1d3f562 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 29 Jun 2017 15:53:54 -0700 Subject: [PATCH 17/25] Remove unused parameters and clean up some code. (#439) --- .../okbuck/generator/BuckFileGenerator.groovy | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy index 47b62b47f..1383b953b 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy @@ -52,20 +52,17 @@ final class BuckFileGenerator { * generate {@code BUCKFile} */ static void generate(Project project) { - OkBuckExtension okbuck = project.rootProject.okbuck - - TestExtension test = okbuck.test - List rules = createRules(project, test.espresso) + List rules = createRules(project) if (rules) { BUCKFile buckFile = new BUCKFile(rules) - PrintStream buckPrinter = new PrintStream(project.file(OkBuckGradlePlugin.BUCK)) - buckFile.print(buckPrinter) - IOUtils.closeQuietly(buckPrinter) + new PrintStream(project.file(OkBuckGradlePlugin.BUCK)).withStream { stream -> + buckFile.print(stream) + } } } - private static List createRules(Project project, boolean espresso) { + private static List createRules(Project project) { List rules = [] ProjectType projectType = ProjectUtil.getType(project) ProjectUtil.getTargets(project).each { String name, Target target -> @@ -94,7 +91,7 @@ final class BuckFileGenerator { } break default: - break + throw new IllegalArgumentException("ProjectType not handled: $projectType") } } From c91223b152c518ac64ff11c5534947bfdc4c8b71 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 29 Jun 2017 15:54:22 -0700 Subject: [PATCH 18/25] Allow transform config to accept project dependencies (#466) --- .../uber/okbuck/core/util/TransformUtil.java | 29 +++++++++++++++++-- .../uber/okbuck/core/util/transform/BUCK_FILE | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/java/com/uber/okbuck/core/util/TransformUtil.java b/buildSrc/src/main/java/com/uber/okbuck/core/util/TransformUtil.java index d3eb8857e..a681df21c 100644 --- a/buildSrc/src/main/java/com/uber/okbuck/core/util/TransformUtil.java +++ b/buildSrc/src/main/java/com/uber/okbuck/core/util/TransformUtil.java @@ -1,12 +1,19 @@ package com.uber.okbuck.core.util; +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableMap; import com.uber.okbuck.OkBuckGradlePlugin; +import com.uber.okbuck.composer.base.BuckRuleComposer; import com.uber.okbuck.core.dependency.DependencyCache; +import com.uber.okbuck.core.model.base.Scope; import org.gradle.api.Project; +import org.gradle.api.artifacts.Configuration; import java.io.File; import java.util.Collections; +import java.util.Set; +import java.util.stream.Collectors; public final class TransformUtil { @@ -22,14 +29,32 @@ public final class TransformUtil { private TransformUtil() { } public static void fetchTransformDeps(Project project) { + Set transformConfigurations = + Collections.singleton(project.getConfigurations().getByName(CONFIGURATION_TRANSFORM)); DependencyCache dependencyCache = new DependencyCache("transform", project.getRootProject(), TRANSFORM_CACHE, - Collections.singleton(project.getConfigurations().getByName(CONFIGURATION_TRANSFORM)), + transformConfigurations, TRANSFORM_FOLDER + TRANSFORM_BUCK_FILE); + Scope transformScope = new Scope( + project, + Collections.singleton(CONFIGURATION_TRANSFORM), + Collections.emptySet(), + null, + Collections.emptyList(), + dependencyCache); + + Set targetDeps = BuckRuleComposer.targets(transformScope.getTargetDeps()) + .stream() + .map(s -> "'" + s + "'") + .collect(Collectors.toSet()); + String allTargetDeps = Joiner.on(", ").join(targetDeps); + FileUtil.copyResourceToProject( - TRANSFORM_FOLDER + TRANSFORM_BUCK_FILE, new File(dependencyCache.getCacheDir(), "BUCK")); + TRANSFORM_FOLDER + TRANSFORM_BUCK_FILE, + new File(dependencyCache.getCacheDir(), "BUCK"), + ImmutableMap.of("template-target-deps", allTargetDeps)); FileUtil.copyResourceToProject( TRANSFORM_FOLDER + TRANSFORM_JAR, new File(dependencyCache.getCacheDir(), TRANSFORM_JAR)); } diff --git a/buildSrc/src/main/resources/com/uber/okbuck/core/util/transform/BUCK_FILE b/buildSrc/src/main/resources/com/uber/okbuck/core/util/transform/BUCK_FILE index ccdb01744..ff1926806 100644 --- a/buildSrc/src/main/resources/com/uber/okbuck/core/util/transform/BUCK_FILE +++ b/buildSrc/src/main/resources/com/uber/okbuck/core/util/transform/BUCK_FILE @@ -22,7 +22,7 @@ for jar in jars: java_binary( name='okbuck_transform', - deps=map(lambda x: ":" + x, jars), + deps=map(lambda x: ":" + x, jars) + [${template-target-deps}], blacklist=[ 'META-INF', ], From f4ff71104abf10e61c375589f3fca7f8a2111147 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 29 Jun 2017 15:56:49 -0700 Subject: [PATCH 19/25] Better error message --- .../groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy index 1383b953b..7d7131d97 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/generator/BuckFileGenerator.groovy @@ -91,7 +91,8 @@ final class BuckFileGenerator { } break default: - throw new IllegalArgumentException("ProjectType not handled: $projectType") + throw new IllegalArgumentException("Okbuck does not support ${project} type projects yet. Please " + + "use the extension option okbuck.buckProjects to exclude ${project}.") } } From 65471eff97c0bdcf3a3325d22372746729b53693 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Thu, 29 Jun 2017 15:58:06 -0700 Subject: [PATCH 20/25] Publish v0.22.3 --- README-zh.md | 2 +- README.md | 2 +- buildSrc/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README-zh.md b/README-zh.md index 661bf82b8..5b5693f88 100644 --- a/README-zh.md +++ b/README-zh.md @@ -9,7 +9,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.22.2' + classpath 'com.uber:okbuck:0.22.3' } } diff --git a/README.md b/README.md index afbe367c1..62fa24f2b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.22.2' + classpath 'com.uber:okbuck:0.22.3' } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index e7fe38d31..1ff9d7414 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -47,7 +47,7 @@ task sourcesJar(type: Jar) { classifier = 'sources' } -def publishVersion = '0.22.2' +def publishVersion = '0.22.3' group = 'com.uber' version = publishVersion def siteUrl = 'https://github.com/uber/okbuck' From bc0e08b6aaec5c5c72f21d59233aa4b598ce6f59 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Wed, 5 Jul 2017 18:18:16 -0700 Subject: [PATCH 21/25] Use relative path for merged proguard file --- .../com/uber/okbuck/core/model/android/AndroidAppTarget.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidAppTarget.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidAppTarget.groovy index fd4d049a0..667054884 100644 --- a/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidAppTarget.groovy +++ b/buildSrc/src/main/groovy/com/uber/okbuck/core/model/android/AndroidAppTarget.groovy @@ -125,7 +125,7 @@ class AndroidAppTarget extends AndroidLibTarget { configs.findAll { File config -> config.exists() }.each { File config -> - mergedConfig += "\n##---- ${config} ----##\n" + mergedConfig += "\n##---- ${FileUtil.getRelativePath(project.rootDir, config)} ----##\n" mergedConfig += config.text } From 469c870e37211533aa1c226a4065121a401ec390 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Mon, 10 Jul 2017 13:44:37 -0400 Subject: [PATCH 22/25] Add logic to buckw to update buck and build it if needed (#469) --- .buckversion | 2 +- buckw | 22 ++++++++++++++++++- .../okbuck/core/util/wrapper/BUCKW_TEMPLATE | 20 +++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.buckversion b/.buckversion index 154c1b4f5..09e97f554 100644 --- a/.buckversion +++ b/.buckversion @@ -1 +1 @@ -bd7dec472d385279ea961789eaf72bc655ca9213 +f685044b764341d952491529c167403e3c3adba6 diff --git a/buckw b/buckw index d91b51fa2..11c4475ac 100755 --- a/buckw +++ b/buckw @@ -4,7 +4,7 @@ ## ## Buck wrapper script to invoke okbuck when needed, before running buck ## -## Created by OkBuck Gradle Plugin on : Wed Apr 19 21:13:00 PDT 2017 +## Created by OkBuck Gradle Plugin on : Mon Jul 10 10:22:56 PDT 2017 ## ######################################################################### @@ -162,6 +162,26 @@ setupBuckBinary ( ) { cd - fi + # Check for current buck version + BUCK_VERSION=$(cat .buckversion) + if [[ ! -z "$BUCK_VERSION" ]]; then + pushd "$BUCK_HOME" >/dev/null + CURRENT_BUCK_VERSION=$(git rev-parse HEAD) + if [[ "$BUCK_VERSION" != "$CURRENT_BUCK_VERSION" ]]; then + info "BUCK VERSION IS AT $CURRENT_BUCK_VERSION , BUT IT SHOULD BE $BUCK_VERSION. UPDATING BUCK" + git clean -fdx --quiet && git reset --hard --quiet && git fetch --all && git checkout "$BUCK_VERSION" --quiet + fi + popd >/dev/null + fi + + # Build buck if needed + if [[ ! -f "$BUCK_HOME/build/successful-build" ]]; then + echo "Buck does not appear to have been built -- building Buck!" + pushd "$BUCK_HOME" >/dev/null + mkdir -p build && ant > build/ant.log && success "BUCK BUILT SUCCESFULLY" || die "FAILED TO BUILD BUCK" + popd >/dev/null + fi + BUCK_BINARY="$BUCK_HOME/bin/buck" fi } diff --git a/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE b/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE index 7e35b67dc..f7750e61f 100644 --- a/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE +++ b/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE @@ -153,6 +153,26 @@ setupBuckBinary ( ) { cd - fi + # Check for current buck version + BUCK_VERSION=$(cat .buckversion) + if [[ ! -z "$BUCK_VERSION" ]]; then + pushd "$BUCK_HOME" >/dev/null + CURRENT_BUCK_VERSION=$(git rev-parse HEAD) + if [[ "$BUCK_VERSION" != "$CURRENT_BUCK_VERSION" ]]; then + info "BUCK VERSION IS AT $CURRENT_BUCK_VERSION , BUT IT SHOULD BE $BUCK_VERSION. UPDATING BUCK" + git clean -fdx --quiet && git reset --hard --quiet && git fetch --all && git checkout "$BUCK_VERSION" --quiet + fi + popd >/dev/null + fi + + # Build buck if needed + if [[ ! -f "$BUCK_HOME/build/successful-build" ]]; then + echo "Buck does not appear to have been built -- building Buck!" + pushd "$BUCK_HOME" >/dev/null + mkdir -p build && ant > build/ant.log && success "BUCK BUILT SUCCESFULLY" || die "FAILED TO BUILD BUCK" + popd >/dev/null + fi + BUCK_BINARY="$BUCK_HOME/bin/buck" fi } From 7e7d37aa7aa9adec64a71aa174f4820aacb1e1ac Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Mon, 10 Jul 2017 15:26:13 -0700 Subject: [PATCH 23/25] Publish v0.22.4 --- README-zh.md | 2 +- README.md | 2 +- buildSrc/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README-zh.md b/README-zh.md index 5b5693f88..7f01e9478 100644 --- a/README-zh.md +++ b/README-zh.md @@ -9,7 +9,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.22.3' + classpath 'com.uber:okbuck:0.22.4' } } diff --git a/README.md b/README.md index 62fa24f2b..7c1c8fa81 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.uber:okbuck:0.22.3' + classpath 'com.uber:okbuck:0.22.4' } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 1ff9d7414..5e84c7c48 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -47,7 +47,7 @@ task sourcesJar(type: Jar) { classifier = 'sources' } -def publishVersion = '0.22.3' +def publishVersion = '0.22.4' group = 'com.uber' version = publishVersion def siteUrl = 'https://github.com/uber/okbuck' From 8dd4bc991dc89658b1c1e0890dee037293ecfe5b Mon Sep 17 00:00:00 2001 From: Chris Woodward Date: Thu, 13 Jul 2017 10:51:43 -0700 Subject: [PATCH 24/25] Set WORKING_DIR to the location of the buck wrapper. (#471) The IntellIj plugin attempts to run buck tests from within the module where the test exists which causes the buck wrapper to fail to locate the gradle wrapper to run the okbuck task. Code taken from: https://stackoverflow.com/questions/59895/getting-the-source-directory-o f-a-bash-script-from-within/246128#246128 --- buckw | 4 ++-- .../com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buckw b/buckw index 11c4475ac..f07c38e26 100755 --- a/buckw +++ b/buckw @@ -4,11 +4,11 @@ ## ## Buck wrapper script to invoke okbuck when needed, before running buck ## -## Created by OkBuck Gradle Plugin on : Mon Jul 10 10:22:56 PDT 2017 +## Created by OkBuck Gradle Plugin on : Thu Jul 13 10:40:45 PDT 2017 ## ######################################################################### -WORKING_DIR=$(pwd) +WORKING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" red=`tput setab 1 2>/dev/null || true` yellow=`tput setab 3 2>/dev/null || true` diff --git a/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE b/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE index f7750e61f..25323fb6a 100644 --- a/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE +++ b/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE @@ -8,7 +8,7 @@ ## ######################################################################### -WORKING_DIR=$(pwd) +WORKING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" red=`tput setab 1 2>/dev/null || true` yellow=`tput setab 3 2>/dev/null || true` From 19a4c2e4958b3fb13f97b8c9c028c8af266f31dd Mon Sep 17 00:00:00 2001 From: Chris Woodward Date: Fri, 14 Jul 2017 21:04:34 -0700 Subject: [PATCH 25/25] Skip OkBuck if we just want to run buck help. (#470) --- buckw | 10 +++++----- .../com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/buckw b/buckw index f07c38e26..172b65c35 100755 --- a/buckw +++ b/buckw @@ -4,7 +4,7 @@ ## ## Buck wrapper script to invoke okbuck when needed, before running buck ## -## Created by OkBuck Gradle Plugin on : Thu Jul 13 10:40:45 PDT 2017 +## Created by OkBuck Gradle Plugin on : Fri Jul 14 10:17:41 PDT 2017 ## ######################################################################### @@ -213,10 +213,10 @@ setupBuckRun ( ) { # Handle parameters and flags handleParams ( ) { - # Go directly to kill. Do not run okbuck. - if [[ "kill" == $1 ]]; then - SKIP_OKBUCK=true - fi + # Go directly to the kill command, help command, or --help option. Do not run okbuck. + if [[ "kill" == $1 || "help" == $1 || $@ == *"--help"* || $@ == *"-h"* ]]; then + SKIP_OKBUCK=true + fi } handleParams "$@" diff --git a/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE b/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE index 25323fb6a..14a90f2cf 100644 --- a/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE +++ b/buildSrc/src/main/resources/com/uber/okbuck/core/util/wrapper/BUCKW_TEMPLATE @@ -204,10 +204,10 @@ setupBuckRun ( ) { # Handle parameters and flags handleParams ( ) { - # Go directly to kill. Do not run okbuck. - if [[ "kill" == $1 ]]; then - SKIP_OKBUCK=true - fi + # Go directly to the kill command, help command, or --help option. Do not run okbuck. + if [[ "kill" == $1 || "help" == $1 || $@ == *"--help"* || $@ == *"-h"* ]]; then + SKIP_OKBUCK=true + fi } handleParams "$@"