Create a gist now

Instantly share code, notes, and snippets.

...
<target name="deploy.new.custom.metadata.type" depends="convert.object.to.metadata.type">
<tempfile property="temp.package.xml" prefix="add.metadata.package." suffix=".xml" deleteonexit="true"/>
<echo file="${temp.package.xml}"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Team_View_Plus_Views_CM__mdt</members>
<name>CustomObject</name>
</types>
<version>${sf.version}</version>
</Package>
]]></echo>
<tempfile property="temp.package.zip" prefix="package." suffix=".zip" deleteonexit="true"/>
<zip destfile="${temp.package.zip}">
<fileset dir="src" includes="objects/Team_View_Plus_Views_CM__mdt.object"/>
<mappedresources>
<fileset file="${temp.package.xml}"/>
<globmapper from="*" to="package.xml"/>
</mappedresources>
</zip>
<deploy file="${temp.package.zip}"/>
</target>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment