Skip to content

Commit

Permalink
Updated profiling tasks to resolve target paths starting with / as is
Browse files Browse the repository at this point in the history
  • Loading branch information
Quesar committed Mar 12, 2024
1 parent ed0dbed commit 958a84b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ public class ProfilingTask extends DefaultTask {

} else if (profileSourceName.endsWith(".plist")) {

File target = new File(targetDir, profile.getTarget())
File target
if (profile.getTarget().startsWith("/")) {
target = new File(profile.getTarget())
} else {
target = new File(targetDir, profile.getTarget())
}
checkWhetherFileExists(target)
logger.info("Profiling file " + source.getAbsolutePath() + " to " + target.getAbsolutePath())
PlistUtil.validatePlist(source)
Expand Down
14 changes: 12 additions & 2 deletions src/main/groovy/lv/ctco/scm/gradle/xcode/ProfilingTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,24 @@ public class ProfilingTask extends DefaultTask {

} else if (profileSourceName.endsWith(".xcconfig")) {

File target = new File(projectDir, profile.getTarget())
File target
if (profile.getTarget().startsWith("/")) {
target = new File(profile.getTarget())
} else {
target = new File(projectDir, profile.getTarget())
}
verifyFileExists(target)
logger.info("Profiling file '{}' to '{}'", source.getAbsolutePath(), target.getAbsolutePath())
XcconfigUtil.applyProfile(source, target);

} else if (profileSourceName.endsWith(".plist")) {

File target = new File(projectDir, profile.getTarget())
File target
if (profile.getTarget().startsWith("/")) {
target = new File(profile.getTarget())
} else {
target = new File(projectDir, profile.getTarget())
}
verifyFileExists(target)
logger.info("Profiling file '{}' to '{}'", source.getAbsolutePath(), target.getAbsolutePath())
PlistUtil.validatePlist(source)
Expand Down

0 comments on commit 958a84b

Please sign in to comment.