-
Notifications
You must be signed in to change notification settings - Fork 3
Add styleguide build command. #93
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
Changes from 7 commits
cc1ecc5
23af2c0
686a08a
47dfa07
eeb45d5
9c03f31
2aea62b
702c67d
b25d333
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| <?xml version="1.0"?> | ||
|
|
||
| <!-- | ||
| @file styleguide.xml | ||
| Targets for managing the styleguide. | ||
|
|
||
| Copyright 2018 Palantir.net, Inc. | ||
| --> | ||
|
|
||
| <project name="Styleguide" default="styleguide"> | ||
| <!-- | ||
| Include this file in your build.xml with: | ||
| <import file="vendor/palantirnet/the-build/tasks/styleguide.xml" /> | ||
| --> | ||
|
|
||
|
|
||
| <fail unless="build.dir" /> | ||
| <fail unless="build.env" /> | ||
| <fail unless="projectname" /> | ||
|
|
||
|
|
||
| <!-- These properties will generally be set in the default build properties file. --> | ||
| <property name="styleguide.root" value="styleguide" /> | ||
| <property name="styleguide.command" value="yarn default" /> | ||
|
|
||
| <!-- This is resolved at runtime. --> | ||
| <resolvepath propertyName="styleguide.root.resolved" file="${styleguide.root}" dir="${build.dir}" /> | ||
|
|
||
|
|
||
| <!-- Target: styleguide-configure --> | ||
| <target name="styleguide-configure" description="Configure the styleguide build."> | ||
| <phing phingfile="${phing.dir.styleguide}/configure.xml" inheritAll="false" dir="${build.dir}"> | ||
| <property name="build.env" value="${build.env}" /> | ||
| <property name="build.dir" value="${build.dir}" /> | ||
|
|
||
| <!-- Load properties from the environment we're editing, with the prefix "default.*" --> | ||
| <property file="${build.dir}/conf/build.${build.env}.properties" prefix="default" /> | ||
| <property file="${build.dir}/conf/build.default.properties" prefix="default" /> | ||
|
|
||
| <!-- Prompts and defaults --> | ||
| <property name="prompt.styleguide.root" value="Style guide directory, relative to the project root" /> | ||
| <property name="default.styleguide.root" value="${styleguide.root}" /> | ||
|
|
||
| <property name="prompt.styleguide.command" value="Style guide build command" /> | ||
| <property name="default.styleguide.command" value="${styleguide.command}" /> | ||
|
|
||
| <property name="update" value="styleguide.root,styleguide.command" /> | ||
| <property name="dump" value="" /> | ||
| </phing> | ||
| </target> | ||
|
|
||
|
|
||
| <!-- Target: styleguide --> | ||
| <target name="styleguide" description="Install and build the style guide."> | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this test whether the properties are set first? That way they can be only run on Circle, if desired.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good point -- especially re: the nodejs installs that vary by platform. The thing is, where the styleguide is built tends to vary between development roles -- folks doing design and front end development will build it locally, but folks doing engineering, devops, or support will build the styleguide within the VM. So I'm not sure where to go with this...
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @becw and @russom-woldezghi, I think I have resolved this by checking for a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested by building the styleguide on my host, then running |
||
| <phingcall target="styleguide-install" /> | ||
|
|
||
| <!-- Run the styleguide build command. --> | ||
| <echo>Running build command in ${styleguide.root}: ${styleguide.command}</echo> | ||
| <exec dir="${styleguide.root.resolved}" command="${styleguide.command}" passthru="true" checkreturn="true" /> | ||
| </target> | ||
|
|
||
|
|
||
| <!-- Target: styleguide-install --> | ||
| <target name="styleguide-install" description="Install the style guide."> | ||
|
|
||
| <!-- Run composer install in the styleguide. --> | ||
| <if> | ||
| <and> | ||
| <available file="${styleguide.root.resolved}/composer.lock" type="file" /> | ||
| <not><available file="${styleguide.root.resolved}/vendor/autoload.php" type="file" /></not> | ||
| </and> | ||
| <then> | ||
| <exec dir="${styleguide.root.resolved}" command="composer install --no-interaction" passthru="true" checkreturn="true" /> | ||
| </then> | ||
| </if> | ||
|
|
||
| <!-- Run yarn install in the styleguide. --> | ||
| <if> | ||
| <and> | ||
| <available file="${styleguide.root.resolved}/yarn.lock" type="file" /> | ||
| <not><available file="${styleguide.root.resolved}/node_modules/.yarn-integrity" type="file" /></not> | ||
| </and> | ||
| <then> | ||
| <exec dir="${styleguide.root.resolved}" command="yarn install --non-interactive --no-progress --prefer-offline" passthru="true" checkreturn="true" /> | ||
| </then> | ||
| </if> | ||
| </target> | ||
|
|
||
|
|
||
| </project> | ||
Uh oh!
There was an error while loading. Please reload this page.