Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.translateCommandsAndPaths #2082

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

Jarod42
Copy link
Contributor

@Jarod42 Jarod42 commented May 14, 2023

What does this PR do?

Improve os.translateCommandsAndPaths.
Fix msvc rule with %[path].
Fix xcode4 with %[path].

How does this PR change Premake's behavior?

For usage of '%[path]'

Anything else we should know?

Add any other context about your changes here.
Tested in my testing repo repo

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

@redorav
Copy link
Collaborator

redorav commented Jul 3, 2023

I've looked at the code, I see what it's trying to do, it would be good to have an example of how it changes the behavior. I've not used the %[path] syntax before, only the %{ }, is there something mentioned in the documentation about it?

@Jarod42
Copy link
Contributor Author

Jarod42 commented Jul 4, 2023

Not mentioned in doc currently.

Planned to add it after this PR (in Token.md and prebuildcommands.md probably).Doc added.

Basically, it is for commands (prebuild/postbuild). to have correct relative path (as those command should be relative to project/solution and not premake5.lua)

@nickclark2016
Copy link
Member

Can you provide samples for how the behavior changes?

@Jarod42 Jarod42 force-pushed the translateCommandsAndPaths branch from 363560a to f0036f3 Compare August 17, 2023 17:21
@Jarod42
Copy link
Contributor Author

Jarod42 commented Aug 17, 2023

@nickclark2016 :
There is 3 fixes:

  • msvc supports %[].
  • xcode supports %[]
  • Fix %[] to supports relative paths.
-- from ./bar/premake5.lua, for (generator) project in ./foo
os.translateCommandsAndPaths("cmdtool %[../foo/path1] %[path2/]", './bar', './foo', 'osx')

returned wrongly
cmdtool "foo/path1" "bar/path2/"
and now
cmdtool "path1" "../bar/path2/"

@Jarod42 Jarod42 force-pushed the translateCommandsAndPaths branch from f0036f3 to be30295 Compare December 9, 2023 14:45
@nickclark2016 nickclark2016 merged commit 5d6d7ff into premake:master Feb 28, 2024
14 checks passed
@Jarod42 Jarod42 deleted the translateCommandsAndPaths branch February 29, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants