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); - } -}