From 105ab312debc0bf5939a48d2a8a887cb8ff7b017 Mon Sep 17 00:00:00 2001 From: carnold Date: Wed, 30 Jan 2008 05:19:46 +0000 Subject: Add projectRoot that XCode 3 keeps asking for git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/cpptasks/trunk@147 32d7a393-a5a9-423c-abd3-5d954feb1f2f --- .../net/sf/antcontrib/cpptasks/apple/XcodeProjectWriter.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java/net/sf/antcontrib/cpptasks/apple') diff --git a/src/main/java/net/sf/antcontrib/cpptasks/apple/XcodeProjectWriter.java b/src/main/java/net/sf/antcontrib/cpptasks/apple/XcodeProjectWriter.java index bbd96f3..1d77c29 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/apple/XcodeProjectWriter.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/apple/XcodeProjectWriter.java @@ -169,8 +169,13 @@ public final class XcodeProjectWriter // // add project to property list // + // + // Calculate path (typically several ../..) of the root directory + // (where build.xml lives) relative to the XCode project directory. + // XCode 3.0 will now prompt user to supply the value if not specified. + String projectRoot = CUtil.getRelativePath(basePath, projectDef.getProject().getBaseDir()); PBXObjectRef project = createPBXProject(compilerConfigurations, mainGroup, - projectDirPath, projectTargets); + projectDirPath, projectRoot, projectTargets); objects.put(project.getID(), project.getProperties()); @@ -564,11 +569,13 @@ public final class XcodeProjectWriter * @param mainGroup main group. * @param projectDirPath project directory path. * @param targets targets. + * @param projectRoot projectRoot directory relative to * @return project. */ private static PBXObjectRef createPBXProject(final PBXObjectRef buildConfigurationList, final PBXObjectRef mainGroup, final String projectDirPath, + final String projectRoot, final List targets) { Map map = new HashMap(); map.put("isa", "PBXProject"); @@ -577,6 +584,7 @@ public final class XcodeProjectWriter map.put("mainGroup", mainGroup.getID()); map.put("projectDirPath", projectDirPath); map.put("targets", targets); + map.put("projectRoot", projectRoot); return new PBXObjectRef(map); } -- cgit v1.2.3