use of com.dd.plist.NSDictionary in project gradle by gradle.
the class XcodeprojSerializer method serializeObject.
/**
* Serialize a {@link PBXObject} and its recursive descendants into the object dictionary.
*
* @return the GID of the serialized object
* @see PBXObject#serializeInto
*/
private String serializeObject(PBXObject obj) {
if (obj.getGlobalID() == null) {
obj.setGlobalID(obj.generateGid(gidGenerator));
LOG.trace("Set new object GID: {}", obj);
} else {
// Check that the object has already been serialized.
NSObject object = objects.get(obj.getGlobalID());
if (object != null) {
LOG.trace("Object {} found, returning existing object {}", obj, object);
return obj.getGlobalID();
} else {
LOG.trace("Object already had GID set: {}", obj);
}
}
// Save the existing object being deserialized.
NSDictionary stack = currentObject;
currentObject = new NSDictionary();
currentObject.put("isa", obj.isa());
obj.serializeInto(this);
objects.put(obj.getGlobalID(), currentObject);
// Restore the existing object being deserialized.
currentObject = stack;
return obj.getGlobalID();
}
use of com.dd.plist.NSDictionary 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;
}
use of com.dd.plist.NSDictionary in project gradle by gradle.
the class GenerateXcodeProjectFileTask method toIndexPbxTarget.
private PBXTarget toIndexPbxTarget(XcodeTarget xcodeTarget) {
PBXNativeTarget target = new PBXNativeTarget("[INDEXING ONLY] " + xcodeTarget.getName(), PBXTarget.ProductType.INDEXER);
target.setProductName(xcodeTarget.getProductName());
target.getBuildPhases().add(newSourceBuildPhase(xcodeTarget.getSources()));
xcodeTarget.getBinaries().forEach(configureBuildSettings(xcodeTarget, target));
// Create unbuildable build configuration so the indexer can keep functioning
if (xcodeTarget.getBinaries().isEmpty()) {
NSDictionary settings = newBuildSettings(xcodeTarget);
target.getBuildConfigurationList().getBuildConfigurationsByName().getUnchecked(UNBUILDABLE_BUILD_CONFIGURATION_NAME).setBuildSettings(settings);
}
return target;
}
use of com.dd.plist.NSDictionary in project gradle by gradle.
the class PBXProject method serializeInto.
@Override
public void serializeInto(XcodeprojSerializer s) {
super.serializeInto(s);
s.addField("mainGroup", mainGroup);
Collections.sort(targets, Ordering.natural().onResultOf(new Function<PBXTarget, String>() {
@Override
public String apply(PBXTarget input) {
return input.getName();
}
}));
s.addField("targets", targets);
s.addField("buildConfigurationList", buildConfigurationList);
s.addField("compatibilityVersion", compatibilityVersion);
NSDictionary d = new NSDictionary();
d.put("LastUpgradeCheck", "0610");
s.addField("attributes", d);
}
use of com.dd.plist.NSDictionary in project gradle by gradle.
the class GenerateXcodeProjectFileTask method newBuildSettings.
private NSDictionary newBuildSettings(XcodeTarget xcodeTarget) {
NSDictionary result = new NSDictionary();
result.put("SWIFT_VERSION", toXcodeSwiftVersion(xcodeTarget.getSwiftSourceCompatibility()));
// Mandatory
result.put("PRODUCT_NAME", xcodeTarget.getProductName());
if (!xcodeTarget.getHeaderSearchPaths().isEmpty()) {
result.put("HEADER_SEARCH_PATHS", toSpaceSeparatedList(xcodeTarget.getHeaderSearchPaths()));
}
if (!xcodeTarget.getCompileModules().isEmpty()) {
result.put("SWIFT_INCLUDE_PATHS", toSpaceSeparatedList(parentDirs(xcodeTarget.getCompileModules())));
}
return result;
}
Aggregations