gradle-native icon indicating copy to clipboard operation
gradle-native copied to clipboard

Handle implicit input/output paths from `PBXShellScriptBuildPhase`

Open lacasseio opened this issue 3 years ago • 0 comments
trafficstars

As a follow-up to https://github.com/nokeedev/gradle-native/issues/661, we should detect or warn the users about possible implicit input/output paths. Suppose the following PBXShellScriptBuildPhase:

41F7087C1F37900A00953630 /* Generate Localized Strings */ = {
		isa = PBXShellScriptBuildPhase;
		buildActionMask = 2147483647;
		files = (
		);
		inputPaths = (
		);
		name = "Generate Localized Strings";
		outputPaths = (
		);
		runOnlyForDeploymentPostprocessing = 0;
		shellPath = /bin/sh;
		shellScript = "python3 Tools/update_strings.py Resources/en.lproj/Localizable.strings\n";
};

The build phase does not declare any input/output paths but the shellScript demonstrate some implicit input/output paths. First the script requires python3 which we could most likely ignore. Then, the python script (e.g. Tools/update_strings.py) should be an input to the build phase. Finally, the argument (i.e. Resources/en.lproj/Localizable.strings) seems to be an input/output paths. In Gradle, using a file as input/output is usually frowned upon as it mostly breaks the up-to-date check. In this case, the user should modify the python script to allow correct up-to-date checks.

Regardless, of how we handle those implicit input/output paths, we will need to request user guidance on how to understand them properly. We could at least understand the <interpreter> <script> construct to automatically detect changes in scripts for major scripting language.

lacasseio avatar Jun 04 '22 20:06 lacasseio