openbakery / gradle-xcodePlugin

gradle plugin for building Xcode Projects for iOS, watchOS, macOS or tvOS
Apache License 2.0
457 stars 129 forks source link

using tasks directly #360

Closed paleozogt closed 2 years ago

paleozogt commented 7 years ago

I have an XCode project with multiple targets. With 0.15.5, it seems that I can use the XCodeBuildTask directly, which is pretty convenient:

task buildTarget1(type:XcodeBuildTask) {
    target= "target1"
}

task buildTarget2(type:XcodeBuildTask) {
    target= "target2"
}

However, doing the same with archive or package doesn't work:

task buildTarget1(type:XcodeBuildArchiveTask) {
    target= "target1"
}

task buildTarget2(type:XcodeBuildArchiveTask) {
    target= "target2"
}

It always archives the same thing no matter what target is set to.

Digging into the code, it seems like the XcodeBuildArchiveTask is always looking in project.xcodebuild for parameters (such as project.xcodebuild.applicationBundle) which means that no matter how we parameterize the task it will only ever use the default from the main xcodebuild DSL.

It's great that these tasks look to the xcodebuild DSL for defaults, but the tasks should be more modular and allow for directly inputting parameters (like XcodeBuildTask does).

renep commented 7 years ago

Yes the goal is that all the tasks can be used directly. For xcodebuild this works, and the goal is that this can be done will all tasks.

paleozogt commented 7 years ago

Ah, I didn't know you were already headed in that direction. :)

Is there a branch I can test on and provide feedback?