@@ -255,7 +255,7 @@ project.ext {
255255 // Directory for testing.
256256 testDir = new File (scriptDirectory, " test_output" )
257257 // Version of the plugin (update this with CHANGELOG.md on each release).
258- pluginVersion = " 1.2.177 "
258+ pluginVersion = " 1.2.178 "
259259 // Directory that contains the template plugin.
260260 // Files under this directory are copied into the staging area for the
261261 // plugin.
@@ -264,14 +264,18 @@ project.ext {
264264 pluginStagingAreaDir = new File (buildDir, " staging" )
265265 // Directory where the build plugin is unpacked to.
266266 pluginExplodedDir = new File (scriptDirectory, " exploded" )
267+ // Directory where the UPM package is unpacked to.
268+ pluginUpmDir = new File (scriptDirectory, " upm" )
267269 // Base filename of the released plugin.
268270 currentPluginBasename = " external-dependency-manager"
271+ // Base UPM package name of the released plugin.
272+ currentPluginUpmPackageName = " com.google.external-dependency-manager"
269273 // Where the exported plugin file is built before it's copied to the release
270274 // location.
271275 pluginExportFile = new File (buildDir, currentPluginBasename + " .unitypackage" )
272276 // Where the exported UPM plugin file is built.
273277 pluginUpmExportFile = new File (buildDir,
274- currentPluginBasename + pluginVersion + " .tgz" )
278+ currentPluginUpmPackageName + " - " + pluginVersion + " .tgz" )
275279 // Directory within the plugin staging area that just contains the plugin.
276280 pluginAssetsDir = new File (" Assets" , " ExternalDependencyManager" )
277281 // Directories within the staging area to export.
@@ -2069,8 +2073,7 @@ buildPlugin.with {
20692073}
20702074
20712075// Guid paths for UPM package.
2072- File upmPluginPackageDir = new File (" com.google.external-dependency-manager" ,
2073- " ExternalDependencyManager" )
2076+ File upmPluginPackageDir = new File (currentPluginUpmPackageName, " ExternalDependencyManager" )
20742077File upmPluginEditorDir = new File (upmPluginPackageDir, " Editor" )
20752078File upmPluginDllDir = new File (upmPluginEditorDir, project. ext. pluginVersion)
20762079
@@ -2121,6 +2124,7 @@ task releasePlugin(dependsOn: [buildPlugin, buildUpmPlugin]) {
21212124 fileTree(dir : project. ext. pluginExplodedDir),
21222125 pluginTemplateFilesMap. values())
21232126 doLast {
2127+ // Delete and regenerate built .unitypackage in the repo.
21242128 delete fileTree(
21252129 dir : project. ext. pluginReleaseFile. parentFile,
21262130 includes : [project. ext. currentPluginBasename + " -*.unitypackage" ])
@@ -2134,6 +2138,7 @@ task releasePlugin(dependsOn: [buildPlugin, buildUpmPlugin]) {
21342138 into project. ext. pluginReleaseFileUnversioned. parentFile
21352139 rename { src_filename -> project. ext. pluginReleaseFileUnversioned. name }
21362140 }
2141+ // Delete and regenerate the exploded plugin folder in the repo.
21372142 delete fileTree(dir : project. ext. pluginExplodedDir)
21382143 copy {
21392144 from project. ext. pluginStagingAreaDir
@@ -2142,6 +2147,16 @@ task releasePlugin(dependsOn: [buildPlugin, buildUpmPlugin]) {
21422147 it. path + " /**/*"
21432148 }
21442149 }
2150+ // Delete and regenerate the UPM package in the repo.
2151+ delete fileTree(dir : project. ext. pluginUpmDir)
2152+ copy {
2153+ // Rename the top-level package folder to upm.
2154+ eachFile {
2155+ path = path. replaceFirst(/ ^.+?\/ / , " upm/" )
2156+ }
2157+ from tarTree(project. ext. pluginUpmExportFile)
2158+ into project. ext. scriptDirectory
2159+ }
21452160 pluginTemplateFilesMap. each {
21462161 sourceFile, targetFile -> copyFile(sourceFile, targetFile)
21472162 }
0 commit comments