title: Expressions in a build rule "Output Files"?
body: <p>Can you include expressions in the "Output Files" section of a build rule in Xcode? Eg:</p>
  
  <p><code>$(DERIVED_FILE_DIR)$(echo "/dynamic/dir")/$(INPUT_FILE_BASE).m</code></p>
  
  <p>Specifically, when translating Java files with j2objc, the resulting files are saved in subfolders, based on the java packages (eg. <code>$(DERIVED_FILE_DIR)/com/google/Class.[hm]</code>). This is without using <code>--no-package-directories</code>, which I can't use because of duplicate file names in different packages.</p>
  
  <p>The issue is in <strong>Output Files</strong>, because Xcode doesn't know how to search for the output file at the correct location. The default location is <code>$(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).m</code>, but I need to perform a string substitution to insert the correct path. However any expression added as <code>$(expression)</code> gets ignored, as it was never there.</p>
  
  <p><img src="https://i.stack.imgur.com/ckRMY.png" alt="enter image description here"></p>
  
  <p>I also tried to export a variable from the custom script and use it in Output Files, but that doesn't work either because the Output Files are transformed into <code>SCRIPT_OUTPUT_FILE_X</code> before the custom script is ran.</p>
  
  <p><img src="https://i.stack.imgur.com/5grp6.png" alt="enter image description here"></p>