org.gradle.platform.base.BinaryContainer Java Examples
The following examples show how to use
org.gradle.platform.base.BinaryContainer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BaseComponentModelPlugin.java From javaide with GNU General Public License v3.0 | 6 votes |
public void createBinaryTasks( final ModelMap<Task> tasks, BinaryContainer binaries, ModelMap<AndroidComponentSpec> specs, TaskManager taskManager) { final VariantManager variantManager = ((DefaultAndroidComponentSpec) specs.get(COMPONENT_NAME)).getVariantManager(); binaries.withType(AndroidBinary.class, new Action<AndroidBinary>() { @Override public void execute(AndroidBinary androidBinary) { DefaultAndroidBinary binary = (DefaultAndroidBinary) androidBinary; variantManager.createTasksForVariantData( new TaskModelMapAdaptor(tasks), binary.getVariantData()); } }); }
Example #2
Source File: LegacyJavaComponentPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
public void apply(final Project target) { target.getPlugins().apply(LanguageBasePlugin.class); BinaryContainer binaryContainer = target.getExtensions().getByType(BinaryContainer.class); binaryContainer.registerFactory(ClassDirectoryBinarySpec.class, new NamedDomainObjectFactory<ClassDirectoryBinarySpec>() { public ClassDirectoryBinarySpec create(String name) { return instantiator.newInstance(DefaultClassDirectoryBinarySpec.class, name, toolChain, new DefaultJavaPlatform(JavaVersion.current())); } }); binaryContainer.withType(ClassDirectoryBinarySpecInternal.class).all(new Action<ClassDirectoryBinarySpecInternal>() { public void execute(ClassDirectoryBinarySpecInternal binary) { createBinaryLifecycleTask(binary, target); setClassesDirConvention(binary, target); createProcessResourcesTaskForBinary(binary, target); createCompileJavaTaskForBinary(binary, target); } }); }
Example #3
Source File: NativeComponentModelPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
@Mutate public void createNativeBinaries(BinaryContainer binaries, NamedDomainObjectSet<NativeComponentSpec> nativeComponents, LanguageRegistry languages, NativeToolChainRegistryInternal toolChains, PlatformContainer platforms, BuildTypeContainer buildTypes, FlavorContainer flavors, ServiceRegistry serviceRegistry, @Path("buildDir") File buildDir) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); NativeDependencyResolver resolver = serviceRegistry.get(NativeDependencyResolver.class); Action<NativeBinarySpec> configureBinaryAction = new NativeBinarySpecInitializer(buildDir); Action<NativeBinarySpec> setToolsAction = new ToolSettingNativeBinaryInitializer(languages); Action<NativeBinarySpec> setDefaultTargetsAction = new ToolSettingNativeBinaryInitializer(languages); @SuppressWarnings("unchecked") Action<NativeBinarySpec> initAction = Actions.composite(configureBinaryAction, setToolsAction, new MarkBinariesBuildable()); NativeBinariesFactory factory = new DefaultNativeBinariesFactory(instantiator, initAction, resolver); BinaryNamingSchemeBuilder namingSchemeBuilder = new DefaultBinaryNamingSchemeBuilder(); Action<NativeComponentSpec> createBinariesAction = new NativeComponentSpecInitializer(factory, namingSchemeBuilder, toolChains, platforms, buildTypes, flavors); for (NativeComponentSpec component : nativeComponents) { createBinariesAction.execute(component); binaries.addAll(component.getBinaries()); } }
Example #4
Source File: NativeBinariesTestPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
@Finalize public void createTestTasks(final TaskContainer tasks, BinaryContainer binaries) { for (NativeTestSuiteBinarySpec testBinary : binaries.withType(NativeTestSuiteBinarySpec.class)) { NativeBinarySpecInternal binary = (NativeBinarySpecInternal) testBinary; final BinaryNamingScheme namingScheme = binary.getNamingScheme(); RunTestExecutable runTask = tasks.create(namingScheme.getTaskName("run"), RunTestExecutable.class); final Project project = runTask.getProject(); runTask.setDescription(String.format("Runs the %s", binary.getNamingScheme().getDescription())); final InstallExecutable installTask = binary.getTasks().withType(InstallExecutable.class).iterator().next(); runTask.getInputs().files(installTask.getOutputs().getFiles()); runTask.setExecutable(installTask.getRunScript().getPath()); runTask.setOutputDir(new File(project.getBuildDir(), "/test-results/" + namingScheme.getOutputDirectoryBase())); } }
Example #5
Source File: LanguageBasePlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
@Mutate void createLifecycleTaskForBinary(TaskContainer tasks, BinaryContainer binaries) { Task assembleTask = tasks.getByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME); for (BinarySpecInternal binary : binaries.withType(BinarySpecInternal.class)) { if (!binary.isLegacyBinary()) { Task binaryLifecycleTask = tasks.create(binary.getNamingScheme().getLifecycleTaskName()); binaryLifecycleTask.setGroup(LifecycleBasePlugin.BUILD_GROUP); binaryLifecycleTask.setDescription(String.format("Assembles %s.", binary)); binary.setBuildTask(binaryLifecycleTask); if (binary.isBuildable()) { assembleTask.dependsOn(binary); } } } }
Example #6
Source File: JvmComponentPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
@Mutate public void createBinaries(BinaryContainer binaries, PlatformContainer platforms, BinaryNamingSchemeBuilder namingSchemeBuilder, NamedDomainObjectCollection<JvmLibrarySpec> libraries, @Path("buildDir") File buildDir, ServiceRegistry serviceRegistry, JavaToolChainRegistry toolChains) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); List<Action<? super JarBinarySpec>> actions = Lists.newArrayList(); actions.add(new JarBinarySpecInitializer(buildDir)); actions.add(new MarkBinariesBuildable()); Action<JarBinarySpec> initAction = Actions.composite(actions); JarBinariesFactory factory = new DefaultJarBinariesFactory(instantiator, initAction); Action<JvmLibrarySpec> createBinariesAction = new JvmLibrarySpecInitializer(factory, namingSchemeBuilder, toolChains, platforms); for (JvmLibrarySpec jvmLibrary : libraries) { createBinariesAction.execute(jvmLibrary); binaries.addAll(jvmLibrary.getBinaries()); } }
Example #7
Source File: JvmComponentPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
@Mutate public void createBinaries(BinaryContainer binaries, PlatformContainer platforms, BinaryNamingSchemeBuilder namingSchemeBuilder, NamedDomainObjectCollection<JvmLibrarySpec> libraries, @Path("buildDir") File buildDir, ServiceRegistry serviceRegistry, JavaToolChainRegistry toolChains) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); List<Action<? super JarBinarySpec>> actions = Lists.newArrayList(); actions.add(new JarBinarySpecInitializer(buildDir)); actions.add(new MarkBinariesBuildable()); Action<JarBinarySpec> initAction = Actions.composite(actions); JarBinariesFactory factory = new DefaultJarBinariesFactory(instantiator, initAction); Action<JvmLibrarySpec> createBinariesAction = new JvmLibrarySpecInitializer(factory, namingSchemeBuilder, toolChains, platforms); for (JvmLibrarySpec jvmLibrary : libraries) { createBinariesAction.execute(jvmLibrary); binaries.addAll(jvmLibrary.getBinaries()); } }
Example #8
Source File: LegacyJavaComponentPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
public void apply(final Project target) { target.getPlugins().apply(LanguageBasePlugin.class); BinaryContainer binaryContainer = target.getExtensions().getByType(BinaryContainer.class); binaryContainer.registerFactory(ClassDirectoryBinarySpec.class, new NamedDomainObjectFactory<ClassDirectoryBinarySpec>() { public ClassDirectoryBinarySpec create(String name) { return instantiator.newInstance(DefaultClassDirectoryBinarySpec.class, name, toolChain, new DefaultJavaPlatform(JavaVersion.current())); } }); binaryContainer.withType(ClassDirectoryBinarySpecInternal.class).all(new Action<ClassDirectoryBinarySpecInternal>() { public void execute(ClassDirectoryBinarySpecInternal binary) { createBinaryLifecycleTask(binary, target); setClassesDirConvention(binary, target); createProcessResourcesTaskForBinary(binary, target); createCompileJavaTaskForBinary(binary, target); } }); }
Example #9
Source File: NativeComponentModelPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
@Mutate public void createNativeBinaries(BinaryContainer binaries, NamedDomainObjectSet<NativeComponentSpec> nativeComponents, LanguageRegistry languages, NativeToolChainRegistryInternal toolChains, PlatformContainer platforms, BuildTypeContainer buildTypes, FlavorContainer flavors, ServiceRegistry serviceRegistry, @Path("buildDir") File buildDir) { Instantiator instantiator = serviceRegistry.get(Instantiator.class); NativeDependencyResolver resolver = serviceRegistry.get(NativeDependencyResolver.class); Action<NativeBinarySpec> configureBinaryAction = new NativeBinarySpecInitializer(buildDir); Action<NativeBinarySpec> setToolsAction = new ToolSettingNativeBinaryInitializer(languages); Action<NativeBinarySpec> setDefaultTargetsAction = new ToolSettingNativeBinaryInitializer(languages); @SuppressWarnings("unchecked") Action<NativeBinarySpec> initAction = Actions.composite(configureBinaryAction, setToolsAction, new MarkBinariesBuildable()); NativeBinariesFactory factory = new DefaultNativeBinariesFactory(instantiator, initAction, resolver); BinaryNamingSchemeBuilder namingSchemeBuilder = new DefaultBinaryNamingSchemeBuilder(); Action<NativeComponentSpec> createBinariesAction = new NativeComponentSpecInitializer(factory, namingSchemeBuilder, toolChains, platforms, buildTypes, flavors); for (NativeComponentSpec component : nativeComponents) { createBinariesAction.execute(component); binaries.addAll(component.getBinaries()); } }
Example #10
Source File: NativeBinariesTestPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
@Finalize public void createTestTasks(final TaskContainer tasks, BinaryContainer binaries) { for (NativeTestSuiteBinarySpec testBinary : binaries.withType(NativeTestSuiteBinarySpec.class)) { NativeBinarySpecInternal binary = (NativeBinarySpecInternal) testBinary; final BinaryNamingScheme namingScheme = binary.getNamingScheme(); RunTestExecutable runTask = tasks.create(namingScheme.getTaskName("run"), RunTestExecutable.class); final Project project = runTask.getProject(); runTask.setDescription(String.format("Runs the %s", binary.getNamingScheme().getDescription())); final InstallExecutable installTask = binary.getTasks().withType(InstallExecutable.class).iterator().next(); runTask.getInputs().files(installTask.getOutputs().getFiles()); runTask.setExecutable(installTask.getRunScript().getPath()); runTask.setOutputDir(new File(project.getBuildDir(), "/test-results/" + namingScheme.getOutputDirectoryBase())); } }
Example #11
Source File: LanguageBasePlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
@Mutate void createLifecycleTaskForBinary(TaskContainer tasks, BinaryContainer binaries) { Task assembleTask = tasks.getByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME); for (BinarySpecInternal binary : binaries.withType(BinarySpecInternal.class)) { if (!binary.isLegacyBinary()) { Task binaryLifecycleTask = tasks.create(binary.getNamingScheme().getLifecycleTaskName()); binaryLifecycleTask.setGroup(LifecycleBasePlugin.BUILD_GROUP); binaryLifecycleTask.setDescription(String.format("Assembles %s.", binary)); binary.setBuildTask(binaryLifecycleTask); if (binary.isBuildable()) { assembleTask.dependsOn(binary); } } } }
Example #12
Source File: CUnitPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
@Mutate public void createCUnitTestBinaries(final BinaryContainer binaries, TestSuiteContainer testSuites, @Path("buildDir") File buildDir, ServiceRegistry serviceRegistry) { for (final CUnitTestSuiteSpec cUnitTestSuite : testSuites.withType(CUnitTestSuiteSpec.class)) { for (NativeBinarySpec testedBinary : cUnitTestSuite.getTestedComponent().getNativeBinaries()) { DefaultCUnitTestSuiteBinary testBinary = createTestBinary(serviceRegistry, cUnitTestSuite, testedBinary); configure(testBinary, buildDir); cUnitTestSuite.getBinaries().add(testBinary); binaries.add(testBinary); } } }
Example #13
Source File: JvmComponentPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
@Mutate public void createTasks(TaskContainer tasks, BinaryContainer binaries) { for (JarBinarySpecInternal projectJarBinary : binaries.withType(JarBinarySpecInternal.class)) { Task jarTask = createJarTask(tasks, projectJarBinary); projectJarBinary.builtBy(jarTask); projectJarBinary.getTasks().add(jarTask); } }
Example #14
Source File: ComponentReport.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
@TaskAction public void report() { Project project = getProject(); StyledTextOutput textOutput = getTextOutputFactory().create(ComponentReport.class); ComponentReportRenderer renderer = new ComponentReportRenderer(getFileResolver()); renderer.setOutput(textOutput); renderer.startProject(project); Collection<ComponentSpec> components = new ArrayList<ComponentSpec>(); ComponentSpecContainer componentSpecs = project.getExtensions().findByType(ComponentSpecContainer.class); if (componentSpecs != null) { components.addAll(componentSpecs); } try { TestSuiteContainer testSuites = getModelRegistry().get(ModelPath.path("testSuites"), ModelType.of(TestSuiteContainer.class)); components.addAll(testSuites); } catch (IllegalStateException e) { // TODO - need a better contract here // Ignore for now } renderer.renderComponents(components); ProjectSourceSet sourceSets = project.getExtensions().findByType(ProjectSourceSet.class); if (sourceSets != null) { renderer.renderSourceSets(sourceSets); } BinaryContainer binaries = project.getExtensions().findByType(BinaryContainer.class); if (binaries != null) { renderer.renderBinaries(binaries); } renderer.completeProject(project); renderer.complete(); }
Example #15
Source File: BinaryTasksRuleDefinitionHandler.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public void mutate(TaskContainer container, Inputs inputs) { BinaryContainer binaries = inputs.get(0, ModelType.of(BinaryContainer.class)).getInstance(); for (T binary : binaries.withType(binaryType)) { NamedEntityInstantiator<Task> instantiator = new Instantiator<Task>(binary, container); DefaultCollectionBuilder<Task> collectionBuilder = new DefaultCollectionBuilder<Task>( getSubject().getPath(), instantiator, new SimpleModelRuleDescriptor("Project.<init>.tasks()"), inputs, modelRegistry); invoke(inputs, collectionBuilder, binary, binaries); } }
Example #16
Source File: NativeBinariesTestPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
@Finalize // Must run after test binaries have been created (currently in CUnit plugin) void attachTestedBinarySourcesToTestBinaries(BinaryContainer binaries) { for (NativeTestSuiteBinarySpec testSuiteBinary : binaries.withType(NativeTestSuiteBinarySpec.class)) { NativeBinarySpec testedBinary = testSuiteBinary.getTestedBinary(); testSuiteBinary.source(testedBinary.getSource()); for (DependentSourceSet testSource : testSuiteBinary.getSource().withType(DependentSourceSet.class)) { testSource.lib(testedBinary.getSource()); } } }
Example #17
Source File: CUnitPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
@Mutate public void createCUnitTestBinaries(final BinaryContainer binaries, TestSuiteContainer testSuites, @Path("buildDir") File buildDir, ServiceRegistry serviceRegistry) { for (final CUnitTestSuiteSpec cUnitTestSuite : testSuites.withType(CUnitTestSuiteSpec.class)) { for (NativeBinarySpec testedBinary : cUnitTestSuite.getTestedComponent().getNativeBinaries()) { DefaultCUnitTestSuiteBinary testBinary = createTestBinary(serviceRegistry, cUnitTestSuite, testedBinary); configure(testBinary, buildDir); cUnitTestSuite.getBinaries().add(testBinary); binaries.add(testBinary); } } }
Example #18
Source File: VisualStudioPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
@Mutate @SuppressWarnings("GroovyUnusedDeclaration") public static void createVisualStudioModelForBinaries(VisualStudioExtensionInternal visualStudioExtension, BinaryContainer binaryContainer) { for (NativeBinarySpec binary : binaryContainer.withType(NativeBinarySpec.class)) { VisualStudioProjectConfiguration configuration = visualStudioExtension.getProjectRegistry().addProjectConfiguration(binary); // Only create a solution if one of the binaries is buildable if (binary.isBuildable()) { DefaultVisualStudioProject visualStudioProject = configuration.getProject(); visualStudioExtension.getSolutionRegistry().addSolution(visualStudioProject); } } }
Example #19
Source File: LanguageBasePlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void apply(final Project target) { target.getPlugins().apply(LifecycleBasePlugin.class); target.getExtensions().create("sources", DefaultProjectSourceSet.class, instantiator); DefaultBinaryContainer binaries = target.getExtensions().create("binaries", DefaultBinaryContainer.class, instantiator); modelRegistry.create( ModelCreators.of(ModelReference.of("binaries", BinaryContainer.class), binaries) .simpleDescriptor("Project.<init>.binaries()") .withProjection(new PolymorphicDomainObjectContainerModelProjection<DefaultBinaryContainer, BinarySpec>(binaries, BinarySpec.class)) .build() ); }
Example #20
Source File: BinaryTypeRuleDefinitionHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private <T extends BinarySpec, U extends BaseBinarySpec> void doRegister(BinaryContainer binaries, ModelType<T> type, final ModelType<U> implementation) { binaries.registerFactory(type.getConcreteClass(), new NamedDomainObjectFactory<T>() { public T create(String name) { BinaryNamingScheme binaryNamingScheme = new DefaultBinaryNamingSchemeBuilder() .withComponentName(name) .build(); // safe because we implicitly know that U extends V, but can't express this in the type system @SuppressWarnings("unchecked") T created = (T) BaseBinarySpec.create(implementation.getConcreteClass(), binaryNamingScheme, instantiator); return created; } }); }
Example #21
Source File: BinaryTasksRuleDefinitionHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void mutate(TaskContainer container, Inputs inputs) { BinaryContainer binaries = inputs.get(0, ModelType.of(BinaryContainer.class)).getInstance(); for (T binary : binaries.withType(binaryType)) { NamedEntityInstantiator<Task> instantiator = new Instantiator<Task>(binary, container); DefaultCollectionBuilder<Task> collectionBuilder = new DefaultCollectionBuilder<Task>( getSubject().getPath(), instantiator, new SimpleModelRuleDescriptor("Project.<init>.tasks()"), inputs, modelRegistry); invoke(inputs, collectionBuilder, binary, binaries); } }
Example #22
Source File: JvmComponentPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
@Mutate public void createTasks(TaskContainer tasks, BinaryContainer binaries) { for (JarBinarySpecInternal projectJarBinary : binaries.withType(JarBinarySpecInternal.class)) { Task jarTask = createJarTask(tasks, projectJarBinary); projectJarBinary.builtBy(jarTask); projectJarBinary.getTasks().add(jarTask); } }
Example #23
Source File: BinaryTypeRuleDefinitionHandler.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private <T extends BinarySpec, U extends BaseBinarySpec> void doRegister(BinaryContainer binaries, ModelType<T> type, final ModelType<U> implementation) { binaries.registerFactory(type.getConcreteClass(), new NamedDomainObjectFactory<T>() { public T create(String name) { BinaryNamingScheme binaryNamingScheme = new DefaultBinaryNamingSchemeBuilder() .withComponentName(name) .build(); // safe because we implicitly know that U extends V, but can't express this in the type system @SuppressWarnings("unchecked") T created = (T) BaseBinarySpec.create(implementation.getConcreteClass(), binaryNamingScheme, instantiator); return created; } }); }
Example #24
Source File: LanguageBasePlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public void apply(final Project target) { target.getPlugins().apply(LifecycleBasePlugin.class); target.getExtensions().create("sources", DefaultProjectSourceSet.class, instantiator); DefaultBinaryContainer binaries = target.getExtensions().create("binaries", DefaultBinaryContainer.class, instantiator); modelRegistry.create( ModelCreators.of(ModelReference.of("binaries", BinaryContainer.class), binaries) .simpleDescriptor("Project.<init>.binaries()") .withProjection(new PolymorphicDomainObjectContainerModelProjection<DefaultBinaryContainer, BinarySpec>(binaries, BinarySpec.class)) .build() ); }
Example #25
Source File: ComponentReport.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
@TaskAction public void report() { Project project = getProject(); StyledTextOutput textOutput = getTextOutputFactory().create(ComponentReport.class); ComponentReportRenderer renderer = new ComponentReportRenderer(getFileResolver()); renderer.setOutput(textOutput); renderer.startProject(project); Collection<ComponentSpec> components = new ArrayList<ComponentSpec>(); ComponentSpecContainer componentSpecs = project.getExtensions().findByType(ComponentSpecContainer.class); if (componentSpecs != null) { components.addAll(componentSpecs); } try { TestSuiteContainer testSuites = getModelRegistry().get(ModelPath.path("testSuites"), ModelType.of(TestSuiteContainer.class)); components.addAll(testSuites); } catch (IllegalStateException e) { // TODO - need a better contract here // Ignore for now } renderer.renderComponents(components); ProjectSourceSet sourceSets = project.getExtensions().findByType(ProjectSourceSet.class); if (sourceSets != null) { renderer.renderSourceSets(sourceSets); } BinaryContainer binaries = project.getExtensions().findByType(BinaryContainer.class); if (binaries != null) { renderer.renderBinaries(binaries); } renderer.completeProject(project); renderer.complete(); }
Example #26
Source File: VisualStudioPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
@Mutate @SuppressWarnings("GroovyUnusedDeclaration") public static void createVisualStudioModelForBinaries(VisualStudioExtensionInternal visualStudioExtension, BinaryContainer binaryContainer) { for (NativeBinarySpec binary : binaryContainer.withType(NativeBinarySpec.class)) { VisualStudioProjectConfiguration configuration = visualStudioExtension.getProjectRegistry().addProjectConfiguration(binary); // Only create a solution if one of the binaries is buildable if (binary.isBuildable()) { DefaultVisualStudioProject visualStudioProject = configuration.getProject(); visualStudioExtension.getSolutionRegistry().addSolution(visualStudioProject); } } }
Example #27
Source File: NativeBinariesTestPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
@Finalize // Must run after test binaries have been created (currently in CUnit plugin) void attachTestedBinarySourcesToTestBinaries(BinaryContainer binaries) { for (NativeTestSuiteBinarySpec testSuiteBinary : binaries.withType(NativeTestSuiteBinarySpec.class)) { NativeBinarySpec testedBinary = testSuiteBinary.getTestedBinary(); testSuiteBinary.source(testedBinary.getSource()); for (DependentSourceSet testSource : testSuiteBinary.getSource().withType(DependentSourceSet.class)) { testSource.lib(testedBinary.getSource()); } } }
Example #28
Source File: BinaryTypeRuleDefinitionHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
public void execute(RegistrationContext<BinarySpec, BaseBinarySpec> context) { BinaryContainer binaries = context.getExtensions().getByType(BinaryContainer.class); doRegister(binaries, context.getType(), context.getImplementation()); }
Example #29
Source File: BinaryTasksRuleDefinitionHandler.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 4 votes |
public BinaryTaskRule(ModelReference<TaskContainer> subject, final Class<T> binaryType, MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry) { super(subject, binaryType, ruleDefinition, ModelReference.of("binaries", BinaryContainer.class)); this.binaryType = binaryType; this.modelRegistry = modelRegistry; }
Example #30
Source File: BinaryTypeRuleDefinitionHandler.java From pushfish-android with BSD 2-Clause "Simplified" License | 4 votes |
public void execute(RegistrationContext<BinarySpec, BaseBinarySpec> context) { BinaryContainer binaries = context.getExtensions().getByType(BinaryContainer.class); doRegister(binaries, context.getType(), context.getImplementation()); }