<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcGIS Pro Custom Addin Version Number in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1510651#M11909</link>
    <description>&lt;P&gt;Since the version element is just a string, you can format the value like below to make replacing it in CI/CD easier. We use Jenkins, so I have a stage to replace {buildNumber} with %BUILD_ID%, then a stage to build the add-in.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;AddInInfo id="{guid}" version="1.2.3.{buildNumber}" desktopVersion="2.9.32739"&amp;gt;...&amp;lt;/AddInInfo&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Note: I haven't looked into this with Pro 3.x; there may be additional functionality to make it easier, but I think editing before building is still required.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2024 15:26:26 GMT</pubDate>
    <dc:creator>tempStephenRhea_NV5</dc:creator>
    <dc:date>2024-07-26T15:26:26Z</dc:date>
    <item>
      <title>ArcGIS Pro Custom Addin Version Number</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1510640#M11908</link>
      <description>&lt;P&gt;Hey there, everyone!&lt;/P&gt;&lt;P&gt;I am currently wondering a way to change the my custom addin version number.&amp;nbsp;&lt;BR /&gt;In the `Config.daml` file, see the `AddInInfo` tag, ArcGIS Pro reads this and displays.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&amp;lt;AddInInfo id="{some-guid}" version="1.0.0" desktopVersion="3.0.36056"&amp;gt; ... &amp;lt;/AddInInfo&amp;gt;&lt;/PRE&gt;&lt;P&gt;In our case, we have a CI/CD pipe line that assigns a new build number. AFAIK `Config.daml` is a static markup, changes have to be done prior to getting build started. So my question is&amp;nbsp;how you all did it? Script it? Is there any Esri api/documentation that I should take a look first? Please share..&lt;BR /&gt;Thank you again,&lt;BR /&gt;Trushar&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 26 Jul 2024 15:08:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1510640#M11908</guid>
      <dc:creator>trushar</dc:creator>
      <dc:date>2024-07-26T15:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Custom Addin Version Number</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1510651#M11909</link>
      <description>&lt;P&gt;Since the version element is just a string, you can format the value like below to make replacing it in CI/CD easier. We use Jenkins, so I have a stage to replace {buildNumber} with %BUILD_ID%, then a stage to build the add-in.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;AddInInfo id="{guid}" version="1.2.3.{buildNumber}" desktopVersion="2.9.32739"&amp;gt;...&amp;lt;/AddInInfo&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Note: I haven't looked into this with Pro 3.x; there may be additional functionality to make it easier, but I think editing before building is still required.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 15:26:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1510651#M11909</guid>
      <dc:creator>tempStephenRhea_NV5</dc:creator>
      <dc:date>2024-07-26T15:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Custom Addin Version Number</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1573353#M12477</link>
      <description>&lt;P&gt;Sorry to hijack this thread, but I'm trying to do exactly the same thing and struggling to figure out the Groovy necessary to update an attribute of an XML node.&amp;nbsp; Would you mind sharing that?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 22:00:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1573353#M12477</guid>
      <dc:creator>DanNarsavage_IDWR</dc:creator>
      <dc:date>2025-01-07T22:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Custom Addin Version Number</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1573785#M12483</link>
      <description>&lt;P&gt;Version number only uses 3 places (3.3.2), the 4th is ignored or, perhaps, throws an error.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 00:22:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1573785#M12483</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2025-01-09T00:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Custom Addin Version Number</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1573933#M12485</link>
      <description>&lt;P&gt;I've successfully placed build numbers there in Pro v3.3. Experimenting a bit more, I found that the "version" attribute of the "AddInInfo" node in Config.daml can be anything. Here's a screen grab of my working addin in Pro's "Add-In Manager" screen to illustrate . . .&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DanNarsavage_IDWR_0-1736434937554.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/123024i82459830ECEE0E28/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DanNarsavage_IDWR_0-1736434937554.png" alt="DanNarsavage_IDWR_0-1736434937554.png" /&gt;&lt;/span&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At any rate, here's the working Groovy function I ended up with in case it helps anyone later.&amp;nbsp; Note that Jenkins will make you approve EACH AND EVERY call to a Java method individually, so be prepared for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;// Takes in the path to the Config.daml file that defines a Pro Addin
// Alters said file's 'AddInInfo' element with an updated 'version' attribute value
def updateAddinMetadata (String damlFilePath, String versionNumber, String environmentName) {
	// Parse the XML and retrieve the "AddInInfo" node
	def xml = readFile damlFilePath
	def arcGIS = new XmlParser().parseText(xml)
	def addinInfoNode = arcGIS.get("AddInInfo").get(0)
	
	// Set version number
	addinInfoNode['@version'] = versionNumber

	// Set build/release date
	dateNode = addinInfoNode.get("Date").get(0)
	dateNode.setValue(new Date().format("dd MMMMMMMMM yyyy"))

	// Set description text
	descriptionNode = addinInfoNode.get("Description").get(0)
	currentDescription = descriptionNode.text().trim()
	descriptionNode.setValue("Built for the ${environmentName} environment\n${currentDescription}")

	// Write the changes to Config.daml
	def writer = new FileWriter(damlFilePath)
	def nodePrinter = new XmlNodePrinter(new PrintWriter(writer))
	nodePrinter.setPreserveWhitespace(true) // without this, the Description &amp;amp; Date nodes are prettified--values placed on separate lines from tags. These newlines are rendered by ArcGIS Pro in the "Add-in Manager" screen and it looks awful
	nodePrinter.print(arcGIS)
	writer.close()
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 16:11:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-custom-addin-version-number/m-p/1573933#M12485</guid>
      <dc:creator>DanNarsavage_IDWR</dc:creator>
      <dc:date>2025-01-09T16:11:23Z</dc:date>
    </item>
  </channel>
</rss>

