Allow passing productPropertiesPath to build.

Allows storing product properties files outside of tools/idea.
This commit is contained in:
Tom Lundell
2015-12-08 11:34:54 +03:00
committed by nik
parent 1bf4404456
commit 558d364281
2 changed files with 9 additions and 1 deletions

View File

@@ -24,6 +24,10 @@
<isset property="product" />
</condition>
<condition property="productPropertiesPath" value="${productPropertiesPath}" else="">
<isset property="productPropertiesPath" />
</condition>
<property name="tmp.dir" value="${out.dir}/tmp"/>
<target name="cleanup">
@@ -55,6 +59,7 @@
<sysproperty key="buildNumber" value="${build.number}" />
<sysproperty key="idea.test.patterns" value="${test.patterns}" />
<sysproperty key="product" value="${product.name}" />
<jvmarg value="-DproductPropertiesPath=${productPropertiesPath}" />
<sysproperty key="java.awt.headless" value="true"/>
<sysproperty key="gant.script" value="@{script}"/>
<sysproperty key="teamcity.build.tempDir" value="${tmp.dir}"/>

View File

@@ -62,7 +62,10 @@ loadProductProperties(home, snapshot)
def loadProductProperties(String home, String buildNumber) {
requireProperty("product", "idea")
def productPropertiesPath = "$home/build/scripts/" + p("product") + "_properties.gant"
requireProperty("productPropertiesPath", "")
if (productPropertiesPath.isEmpty()) {
productPropertiesPath = "$home/build/scripts/" + p("product") + "_properties.gant";
}
if (!new File(productPropertiesPath).exists()) {
throw new BuildException("No product specific properties file found at: " + productPropertiesPath)
}