Search in sources :

Example 1 with Builder

use of com.google.devtools.build.lib.rules.objc.Bundling.Builder in project bazel by bazelbuild.

the class ReleaseBundlingSupport method bundling.

private Bundling bundling(RuleContext ruleContext, ObjcProvider objcProvider, String bundleDirFormat, String bundleName, DottedVersion minimumOsVersion) {
    ImmutableList<BundleableFile> extraBundleFiles;
    AppleConfiguration appleConfiguration = ruleContext.getFragment(AppleConfiguration.class);
    if (platform.isDevice()) {
        extraBundleFiles = ImmutableList.of(new BundleableFile(releaseBundling.getProvisioningProfile(), PROVISIONING_PROFILE_BUNDLE_FILE));
    } else {
        extraBundleFiles = ImmutableList.of();
    }
    Bundling.Builder bundling = new Builder().setName(bundleName).setExecutableName(bundleName).setArchitecture(appleConfiguration.getDependencySingleArchitecture()).setBundleDirFormat(bundleDirFormat).addExtraBundleFiles(extraBundleFiles).setObjcProvider(objcProvider).setIntermediateArtifacts(intermediateArtifacts).setPrimaryBundleId(releaseBundling.getPrimaryBundleId()).setFallbackBundleId(releaseBundling.getFallbackBundleId()).setMinimumOsVersion(minimumOsVersion).setArtifactPrefix(releaseBundling.getArtifactPrefix()).setTargetDeviceFamilies(releaseBundling.getTargetDeviceFamilies());
    // Add plists from rule first.
    if (releaseBundling.getInfoPlistsFromRule() != null) {
        bundling.addInfoplistInputs(releaseBundling.getInfoPlistsFromRule());
    } else {
        bundling.addInfoplistInputFromRule(ruleContext);
    }
    // Add generated plists next so that generated values can override the default values in the
    // plists from rule.
    bundling.setAutomaticEntriesInfoplistInput(getGeneratedAutomaticPlist()).addInfoplistInput(getGeneratedVersionPlist()).addInfoplistInput(getGeneratedEnvironmentPlist()).addInfoplistInputs(releaseBundling.getInfoplistInputs());
    if (releaseBundling.getLaunchStoryboard() != null) {
        bundling.addInfoplistInput(getLaunchStoryboardPlist());
    }
    return bundling.build();
}
Also used : NestedSetBuilder(com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder) Builder(com.google.devtools.build.lib.rules.objc.Bundling.Builder) Builder(com.google.devtools.build.lib.rules.objc.Bundling.Builder) AppleConfiguration(com.google.devtools.build.lib.rules.apple.AppleConfiguration)

Aggregations

NestedSetBuilder (com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder)1 AppleConfiguration (com.google.devtools.build.lib.rules.apple.AppleConfiguration)1 Builder (com.google.devtools.build.lib.rules.objc.Bundling.Builder)1