当前位置: 首页>>代码示例>>Java>>正文


Java SharedLibraryBinarySpec类代码示例

本文整理汇总了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());
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:27,代码来源:CompileTaskConfig.java

示例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")));
                }
            }));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:NdkComponentModelPlugin.java

示例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);
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:StlConfiguration.java

示例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"
            : "";
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:VisualStudioProjectMapper.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:StripDebugSymbolTask.java

示例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);
                }
            }
        });
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:NdkComponentModelPlugin.java

示例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);
                        }
                    }
                });
    }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:NdkComponentModelPlugin.java

示例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())));
                }
            });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:NdkComponentModelPlugin.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:NdkConfiguration.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:NdkConfiguration.java

示例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)));
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:16,代码来源:NativeBinarySpecInitializer.java

示例12: getTasks

import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@Override
public SharedLibraryBinarySpec.TasksCollection getTasks() {
    return tasks;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultSharedLibraryBinarySpec.java

示例13: getTargetType

import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@Override
public Class<SharedLibraryBinarySpec> getTargetType() {
    return SharedLibraryBinarySpec.class;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:SharedLibraryBinaryRenderer.java

示例14: renderOutputs

import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@Override
protected void renderOutputs(SharedLibraryBinarySpec binary, TextReportBuilder builder) {
    builder.item("shared library file", binary.getSharedLibraryFile());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:SharedLibraryBinaryRenderer.java

示例15: registerSharedLibraryBinaryType

import org.gradle.nativeplatform.SharedLibraryBinarySpec; //导入依赖的package包/类
@ComponentType
void registerSharedLibraryBinaryType(TypeBuilder<SharedLibraryBinarySpec> builder) {
    builder.defaultImplementation(DefaultSharedLibraryBinarySpec.class);
    builder.internalView(SharedLibraryBinarySpecInternal.class);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:NativeComponentModelPlugin.java


注:本文中的org.gradle.nativeplatform.SharedLibraryBinarySpec类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。