XCodePackageManager { static File getPublicHeaderFolderPath(String builtProductDirInsideXcodeProject, String publicHeaderFolderPathInsideXcodeProject, String relativeAlternatePublicHeaderFolderPath) throws XCodeException { final String relativePublicHeaderFolderPathInXcodeProject = publicHeaderFolderPathInsideXcodeProject; final String relativePublicHeaderFolderPath; if (StringUtils.isEmpty(relativeAlternatePublicHeaderFolderPath)) { relativePublicHeaderFolderPath = relativePublicHeaderFolderPathInXcodeProject; LOGGER.info( "Using public header folder path as it is configured in the xcode project: '" + relativePublicHeaderFolderPathInXcodeProject + "'."); } else { relativePublicHeaderFolderPath = relativeAlternatePublicHeaderFolderPath; if (!com.sap.prd.mobile.ios.mios.FileUtils.isChild( new File( com.sap.prd.mobile.ios.mios.FileUtils.ensureLeadingSlash(relativeAlternatePublicHeaderFolderPath)), new File( com.sap.prd.mobile.ios.mios.FileUtils .ensureLeadingSlash(relativePublicHeaderFolderPathInXcodeProject)))) throw new InvalidAlternatePublicHeaderPathException( "Public header folder path configured on the level of xcode-maven-plugin configuration (" + relativeAlternatePublicHeaderFolderPath + ") is not a parent folder of the public header path configured inside the xcode project (" + relativePublicHeaderFolderPathInXcodeProject + ")."); LOGGER.info( "Using public header folder path as it is defined inside the xcode-maven-plugin (" + relativeAlternatePublicHeaderFolderPath + "). In the xcode project '" + relativePublicHeaderFolderPathInXcodeProject + "' is configured as public header folder path."); } return new File(builtProductDirInsideXcodeProject, com.sap.prd.mobile.ios.mios.FileUtils.ensureLeadingSlash(relativePublicHeaderFolderPath)); } XCodePackageManager(final ArchiverManager archiverManager, final MavenProjectHelper projectHelper);   }
@Test public void testGetPublicHeaderFolderPathNoAlternate() throws XCodeException { assertEquals(new File("build/Release-iphoneos/include/MyApp"), XCodePackageManager.getPublicHeaderFolderPath( "build/Release-iphoneos", "include/MyApp", null)); }
@Test public void testGetPublicHeaderFolderPathAlternateWithoutLeadingSlash() throws XCodeException { assertEquals(new File("build/Release-iphoneos/include"), XCodePackageManager.getPublicHeaderFolderPath( "build/Release-iphoneos", "include/MyApp", "include")); }
@Test public void testGetPublicHeaderFolderPathAlternateWithLeadingSlash() throws XCodeException { assertEquals(new File("build/Release-iphoneos/include"), XCodePackageManager.getPublicHeaderFolderPath( "build/Release-iphoneos", "include/MyApp", "/include")); }
@Test public void testGetPublicHeaderFolderPathPropertyInXcodeWithLeadingSlashAlternateWithoutSlash() throws XCodeException { assertEquals(new File("build/Release-iphoneos/include"), XCodePackageManager.getPublicHeaderFolderPath( "build/Release-iphoneos", "/include/MyApp", "include")); }
@Test public void testGetPublicHeaderFolderPathPropertyInXcodeWithLeadingSlashAlternateAlsoWithSlash() throws XCodeException { assertEquals(new File("build/Release-iphoneos/include"), XCodePackageManager.getPublicHeaderFolderPath( "build/Release-iphoneos", "/include/MyApp", "/include")); }
@Test public void testGetPublicHeaderFolderPathAlternateWithTrailingSlash() throws XCodeException { assertEquals(new File("build/Release-iphoneos/include"), XCodePackageManager.getPublicHeaderFolderPath( "build/Release-iphoneos", "include/MyApp", "/include/")); }
@Test(expected = InvalidAlternatePublicHeaderPathException.class) public void testGetPublicHeaderFolderPathAlternateWithoutParentChildRelationship() throws XCodeException { XCodePackageManager.getPublicHeaderFolderPath("build/Release-iphoneos", "include/MyApp", "/include123/"); }