本文整理汇总了Java中org.gradle.nativeplatform.SharedLibraryBinarySpec类的典型用法代码示例。如果您正苦于以下问题:Java SharedLibraryBinarySpec类的具体用法?Java SharedLibraryBinarySpec怎么用?Java SharedLibraryBinarySpec使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SharedLibraryBinarySpec类属于org.gradle.nativeplatform包,在下文中一共展示了SharedLibraryBinarySpec类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureCompileTaskCommon
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
private void configureCompileTaskCommon(AbstractNativeCompileTask task, final NativeBinarySpecInternal binary, final LanguageSourceSetInternal sourceSet) {
task.setToolChain(binary.getToolChain());
task.setTargetPlatform(binary.getTargetPlatform());
task.setPositionIndependentCode(binary instanceof SharedLibraryBinarySpec);
task.includes(((HeaderExportingSourceSet) sourceSet).getExportedHeaders().getSourceDirectories());
task.includes(new Callable<List<FileCollection>>() {
public List<FileCollection> call() {
Collection<NativeDependencySet> libs = binary.getLibs((DependentSourceSet) sourceSet);
return CollectionUtils.collect(libs, new Transformer<FileCollection, NativeDependencySet>() {
public FileCollection transform(NativeDependencySet original) {
return original.getIncludeRoots();
}
});
}
});
for (String toolName : languageTransform.getBinaryTools().keySet()) {
Tool tool = binary.getToolByName(toolName);
if (tool instanceof PreprocessingTool) {
task.setMacros(((PreprocessingTool) tool).getMacros());
}
task.setCompilerArgs(tool.getArgs());
}
}
示例2: getNativeBinaries
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
private static Collection<SharedLibraryBinarySpec> getNativeBinaries(
NativeLibrarySpec library,
final BuildType buildType,
final List<ProductFlavor> productFlavors) {
final ProductFlavorCombo<ProductFlavor> flavorGroup =
new ProductFlavorCombo<ProductFlavor>(productFlavors);
return ImmutableList.copyOf(Iterables.filter(
library.getBinaries().withType(SharedLibraryBinarySpec.class).values(),
new Predicate<SharedLibraryBinarySpec>() {
@Override
public boolean apply(SharedLibraryBinarySpec binary) {
return binary.getBuildType().getName().equals(buildType.getName())
&& (binary.getFlavor().getName().equals(flavorGroup.getName())
|| (productFlavors.isEmpty()
&& binary.getFlavor().getName().equals("default")));
}
}));
}
示例3: createStlCopyTask
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
public static void createStlCopyTask(NdkHandler ndkHandler, String stl,
ModelMap<Task> tasks, final File buildDir,
final SharedLibraryBinarySpec binary) {
if (stl.endsWith("_shared")) {
final StlNativeToolSpecification stlConfig = new StlNativeToolSpecification(ndkHandler,
stl, binary.getTargetPlatform());
String copyTaskName = NdkNamingScheme.getTaskName(binary, "copy", "StlSo");
tasks.create(copyTaskName, Copy.class, new Action<Copy>() {
@Override
public void execute(Copy copy) {
copy.from(stlConfig.getStlLib(binary.getTargetPlatform().getName()));
copy.into(new File(buildDir, NdkNamingScheme.getOutputDirectoryName(binary)));
}
});
binary.getBuildTask().dependsOn(copyTaskName);
}
}
示例4: projectSuffix
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
private String projectSuffix(NativeBinarySpec nativeBinary) {
return nativeBinary instanceof SharedLibraryBinarySpec ? "Dll"
: nativeBinary instanceof StaticLibraryBinarySpec ? "Lib"
: nativeBinary instanceof NativeExecutableBinarySpec ? "Exe"
: nativeBinary instanceof NativeTestSuiteBinarySpec ? "Exe"
: "";
}
示例5: ConfigAction
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
public ConfigAction(
@NonNull SharedLibraryBinarySpec binary,
@NonNull File buildDir,
@NonNull NdkHandler handler) {
this.binary = binary;
this.buildDir = buildDir;
this.handler = handler;
}
示例6: createAdditionalTasksForNatives
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@Mutate
public void createAdditionalTasksForNatives(
final ModelMap<Task> tasks,
ModelMap<AndroidComponentSpec> specs,
@Path("android.ndk") final NdkConfig ndkConfig,
final NdkHandler ndkHandler,
BinaryContainer binaries,
@Path("buildDir") final File buildDir) {
if (!ndkHandler.isNdkDirConfigured()) {
return;
}
final DefaultAndroidComponentSpec androidSpec =
(DefaultAndroidComponentSpec) specs.get(COMPONENT_NAME);
if (androidSpec.getNativeLibrary() != null) {
binaries.withType(DefaultAndroidBinary.class, new Action<DefaultAndroidBinary>() {
@Override
public void execute(DefaultAndroidBinary binary) {
for (NativeBinarySpec nativeBinary : binary.getNativeBinaries()) {
NdkConfiguration.createTasks(
tasks,
(SharedLibraryBinarySpec)nativeBinary,
buildDir,
binary.getMergedNdkConfig(),
ndkHandler);
}
}
});
}
}
示例7: configureNativeBinary
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@Mutate
public void configureNativeBinary(
BinaryContainer binaries,
ComponentSpecContainer specs,
@Path("android.ndk") final NdkConfig ndkConfig,
@Path("buildDir") final File buildDir,
final NdkHandler ndkHandler) {
if (!ndkConfig.getModuleName().isEmpty()) {
final NativeLibrarySpec library = specs.withType(NativeLibrarySpec.class)
.get(ndkConfig.getModuleName());
binaries.withType(DefaultAndroidBinary.class, new Action<DefaultAndroidBinary>() {
@Override
public void execute(DefaultAndroidBinary binary) {
binary.computeMergedNdk(
ndkConfig,
binary.getProductFlavors(),
binary.getBuildType());
Collection<SharedLibraryBinarySpec> nativeBinaries =
getNativeBinaries(
library,
binary.getBuildType(),
binary.getProductFlavors());
binary.getNativeBinaries().addAll(nativeBinaries);
for (SharedLibraryBinarySpec nativeBin : nativeBinaries) {
NdkConfiguration.configureBinary(
nativeBin,
buildDir,
binary.getMergedNdkConfig(),
ndkHandler);
}
}
});
}
}
示例8: getBinaries
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
/**
* Return library binaries for a VariantConfiguration.
*/
public Collection<SharedLibraryBinarySpec> getBinaries(final VariantConfiguration variantConfig) {
if (variantConfig.getType().isForTesting()) {
// Do not return binaries for test variants as test source set is not supported at the
// moment.
return Collections.emptyList();
}
final GradleVariantConfiguration config = (GradleVariantConfiguration) variantConfig;
BinaryContainer binaries = (BinaryContainer) project.getExtensions().getByName("binaries");
return binaries.withType(SharedLibraryBinarySpec.class).matching(
new Spec<SharedLibraryBinarySpec>() {
@Override
public boolean isSatisfiedBy(SharedLibraryBinarySpec binary) {
return (binary.getBuildType().getName()
.equals(config.getBuildType().getName())
&& (binary.getFlavor().getName().equals(config.getFlavorName())
|| (binary.getFlavor().getName().equals("default")
&& config.getFlavorName().isEmpty()))
&& (config.getNdkConfig().getAbiFilters() == null
|| config.getNdkConfig().getAbiFilters().isEmpty()
|| config.getNdkConfig().getAbiFilters().contains(
binary.getTargetPlatform().getName())));
}
});
}
示例9: createTasks
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
public static void createTasks(ModelMap<Task> tasks, SharedLibraryBinarySpec binary,
File buildDir, NdkConfig ndkConfig, NdkHandler ndkHandler) {
StlConfiguration.createStlCopyTask(ndkHandler, ndkConfig.getStl(), tasks, buildDir, binary);
if (Boolean.TRUE.equals(ndkConfig.getDebuggable())) {
// TODO: Use AndroidTaskRegistry and scopes to create tasks in experimental plugin.
setupNdkGdbDebug(tasks, binary, buildDir, ndkConfig, ndkHandler);
}
createStripDebugTask(tasks, binary, buildDir, ndkHandler);
}
示例10: createStripDebugTask
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
private static void createStripDebugTask(
ModelMap<Task> tasks,
final SharedLibraryBinarySpec binary,
final File buildDir,
final NdkHandler handler) {
String taskName = NdkNamingScheme.getTaskName(binary, "stripSymbols");
tasks.create(
taskName,
StripDebugSymbolTask.class,
new StripDebugSymbolTask.ConfigAction(binary, buildDir, handler));
binary.getBuildTask().dependsOn(taskName);
}
示例11: execute
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
public void execute(NativeBinarySpec nativeBinary) {
BinaryNamingScheme namingScheme = ((NativeBinarySpecInternal) nativeBinary).getNamingScheme();
PlatformToolProvider toolProvider = ((NativeBinarySpecInternal) nativeBinary).getPlatformToolProvider();
File binaryOutputDir = new File(binariesOutputDir, namingScheme.getOutputDirectoryBase());
String baseName = nativeBinary.getComponent().getBaseName();
if (nativeBinary instanceof NativeExecutableBinarySpec) {
((NativeExecutableBinarySpec) nativeBinary).setExecutableFile(new File(binaryOutputDir, toolProvider.getExecutableName(baseName)));
} else if (nativeBinary instanceof SharedLibraryBinarySpec) {
((SharedLibraryBinarySpec) nativeBinary).setSharedLibraryFile(new File(binaryOutputDir, toolProvider.getSharedLibraryName(baseName)));
((SharedLibraryBinarySpec) nativeBinary).setSharedLibraryLinkFile(new File(binaryOutputDir, toolProvider.getSharedLibraryLinkFileName(baseName)));
} else if (nativeBinary instanceof StaticLibraryBinarySpec) {
((StaticLibraryBinarySpec) nativeBinary).setStaticLibraryFile(new File(binaryOutputDir, toolProvider.getStaticLibraryName(baseName)));
}
}
示例12: getTasks
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@Override
public SharedLibraryBinarySpec.TasksCollection getTasks() {
return tasks;
}
示例13: getTargetType
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@Override
public Class<SharedLibraryBinarySpec> getTargetType() {
return SharedLibraryBinarySpec.class;
}
示例14: renderOutputs
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@Override
protected void renderOutputs(SharedLibraryBinarySpec binary, TextReportBuilder builder) {
builder.item("shared library file", binary.getSharedLibraryFile());
}
示例15: registerSharedLibraryBinaryType
import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@ComponentType
void registerSharedLibraryBinaryType(TypeBuilder<SharedLibraryBinarySpec> builder) {
builder.defaultImplementation(DefaultSharedLibraryBinarySpec.class);
builder.internalView(SharedLibraryBinarySpecInternal.class);
}