use of org.gradle.ide.xcode.internal.xcodeproj.PBXLegacyTarget in project gradle by gradle.
the class GenerateXcodeProjectFileTask method toToolAndLibraryPbxTarget.
private PBXTarget toToolAndLibraryPbxTarget(XcodeTarget xcodeTarget) {
PBXLegacyTarget target = new PBXLegacyTarget(xcodeTarget.getName(), xcodeTarget.getProductType());
target.setProductName(xcodeTarget.getProductName());
target.setBuildToolPath(xcodeTarget.getGradleCommand());
target.setBuildArgumentsString(buildGradleArgs(xcodeTarget));
target.setGlobalID(xcodeTarget.getId());
File outputFile = xcodeTarget.getDebugOutputFile().get().getAsFile();
target.setProductReference(new PBXFileReference(outputFile.getName(), outputFile.getAbsolutePath(), PBXReference.SourceTree.ABSOLUTE));
xcodeTarget.getBinaries().forEach(xcodeBinary -> {
NSDictionary settings = target.getBuildConfigurationList().getBuildConfigurationsByName().getUnchecked(xcodeBinary.getBuildConfigurationName()).getBuildSettings();
File binaryOutputFile = xcodeBinary.getOutputFile().get().getAsFile();
settings.put("CONFIGURATION_BUILD_DIR", new NSString(binaryOutputFile.getParentFile().getAbsolutePath()));
settings.put("PRODUCT_NAME", target.getProductName());
settings.put("SWIFT_VERSION", toXcodeSwiftVersion(xcodeTarget.getSwiftSourceCompatibility()));
settings.put("ARCHS", toXcodeArchitecture(xcodeBinary.getArchitectureName()));
settings.put("VALID_ARCHS", xcodeTarget.getBinaries().stream().map(XcodeBinary::getArchitectureName).map(GenerateXcodeProjectFileTask::toXcodeArchitecture).distinct().collect(Collectors.joining(" ")));
});
return target;
}
Aggregations