SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,161
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)

    Phing - Replaceable Parameters?

    I'm new to phing, so I may be missing something obvious here, but I have the following that packages a chrome extension

    Code xml:
    <exec command="&quot;C:\PortableApps\GoogleChromePortable\GoogleChromePortable.exe&quot; --pack-extension=&quot;M:\GIT\Playground\my-scripts\chrome\my_extension&quot; --pack-extension-key=&quot;M:\GIT\Playground\my-scripts\chrome\my_extension.pem&quot;" dir="." logoutput="true" />

    I'm curious if I can replace the paths that are hard coded with some kind of parameter... Something like %chrome%. The hard coded paths are ugly and won't cross workstations very well (if I were to ever add another team member).

    Two things to note:
    1) The --pack-extension and --pack-extension-key MUST be Full Paths (I tried relative, it fails to generate the crx files)
    2) It must create the crx within the my-scripts\chrome folder (which it does now).

    Thoughts?

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,084
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    The way I do this is by using a properties file.

    In build.xml put <property file="./build.properties" /> and create a file called build.properties with contents like so

    Code:
    chrome.exe=C:\PortableApps\GoogleChromePortable\GoogleChromePortable.exe
    chrome.ext_dir=M:\GIT\Playground\my-scripts\chrome\my_extension
    chrome.pem_file=M:\GIT\Playground\my-scripts\chrome\my_extension.pem
    and then in the original build.xml it becomes:

    Code xml:
    <exec command="&quot;${chrome.exe}&quot; --pack-extension=&quot;${chrome.ext_dir}&quot; --pack-extension-key=&quot;${chrome.pem_file}&quot;" dir="." logoutput="true" />
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,161
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Cool, then do you usually set that file to ignore? and just checkin a basic example one for the other devs to use as a template?

  4. #4
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,084
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by cpradio View Post
    Cool, then do you usually set that file to ignore? and just checkin a basic example one for the other devs to use as a template?
    Yup
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  5. #5
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,161
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Sweet, that worked like a charm


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •