Thread Tools Display Modes
05/03/20, 01:59 AM   #1
Aenathel
 
Aenathel's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2020
Posts: 8
How to prevent Minion from overriding the development version of my add-on?

Hi all, just made my first ESO add-on and having a lot of fun.

I published the add-on to ESOUI yesterday after only having worked on it locally, but fortunately using Git for version control from the beginning.

The first time I opened Minion after submitting my add-on, Minion completely replaced my development version with the released version... which also wiped out the changes I was working on plus some files I don't commit to Git.

Fortunately, I often push my changes to my remote (I use Azure DevOps for my projects), but I'd rather not have this happen again. Is there a way I can prevent Minion from overriding my development version while still having automatic add-on updates enabled?

My thoughts so far are to either:
  1. Use a different name for the development version, but I'd rather not do that...
  2. Set the AddOnVersion in the manifest to something like 9999, but then I have to update that every time I do a release. (I guess I'll automate it if so, but it's still additional work.)
Any thoughts?

Last edited by Aenathel : 05/03/20 at 04:08 AM.
  Reply With Quote
05/03/20, 02:25 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
Personally I recommend you do not keep your development version in the AddOns folder, simply because of Minion. It will remove all folders in the root of an addon on update. You can ignore a specific addon update by right clicking it and selecting ignore, but if some other addon were to add the folder for any reason and you update, it will still delete it.

I use some scripts to "build" my addons and copy them to the target folder. That way it doesn't matter even when I just delete the whole folder.
  Reply With Quote
05/03/20, 02:29 AM   #3
Aenathel
 
Aenathel's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2020
Posts: 8
Originally Posted by sirinsidiator View Post
Personally I recommend you do not keep your development version in the AddOns folder, simply because of Minion. It will remove all folders in the root of an addon on update. You can ignore a specific addon update by right clicking it and selecting ignore, but if some other addon were to add the folder for any reason and you update, it will still delete it.

I use some scripts to "build" my addons and copy them to the target folder. That way it doesn't matter even when I just delete the whole folder.
That's a good point. And I can just set up a file watcher to do this for me when I'm developing. I'm going to need those scripts for my release pipeline anyway. Thanks for the insight!
  Reply With Quote
05/03/20, 04:07 AM   #4
Aenathel
 
Aenathel's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2020
Posts: 8
All right, created a few PowerShell scripts to take care of this and hooked it up to a file watcher in WebStorm, works beautifully.
  Reply With Quote
05/03/20, 06:50 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Sounds like a helper, are you able to share it with us (maybe) if possible?
  Reply With Quote
05/03/20, 07:03 AM   #6
Aenathel
 
Aenathel's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2020
Posts: 8
Sure. It's a bit rough, I have specified the necessary files manually, but I'll add some better filtering later.

The first script is bin/build.ps1, which copies files to a build/ directory and substitutes some variables:

Code:
Param(
    [Parameter()]
    [string] $AddOnVersion = "1",
    [Parameter()]
    [string] $Version = "0.0.0",
    [Parameter()]
    [string] $SavedVariables = "AenathelsKeybinds_SavedVariables"
)

$PSDefaultParameterValues['Out-File:Encoding'] = "utf8"

Remove-Item -Force -Recurse build -ErrorAction SilentlyContinue
New-Item -Type Directory -Path build > $null

Copy-Item AenathelsKeybinds.lua -Destination build/
Copy-Item AenathelsKeybinds.txt -Destination build/

Copy-Item CHANGELOG -Destination build/
Copy-Item DESCRIPTION -Destination build/
Copy-Item LICENSE -Destination build/

Copy-Item -Recurse -Path lang -Destination build/lang
Copy-Item -Recurse -Path xml -Destination build/xml

$manifest = Get-Content build/AenathelsKeybinds.txt | Out-String
$manifest = $manifest -replace "{{AddOnVersion}}", $AddOnVersion
$manifest = $manifest -replace "{{Version}}", $Version
$manifest = $manifest -replace "{{SavedVariables}}", $SavedVariables
$manifest | Set-Content build/AenathelsKeybinds.txt

$shared = Get-Content build/lang/shared.lua | Out-String
$shared = $shared -replace "{{Version}}", $Version
$shared | Set-Content build/lang/shared.lua
The second script is bin/deploy.ps1, which copies the build output to the AddOns folder:

Code:
Param(
    [Parameter()]
    [string] $AddOnsFolder = "$env:USERPROFILE\Documents\Elder Scrolls Online\live\AddOns"
)

. bin\build.ps1

$path = "$AddOnsFolder\AenathelsKeybinds"

Remove-Item -Force -Recurse $path -ErrorAction SilentlyContinue
New-Item -Force -Type Directory -Path $path > $null

Copy-Item -Force -Recurse -Path build/* -Destination $path
Finally, here's the raw watcher task--if you're using WebStorm or something like it, it should be possible to splice it into your existing .idea/watcherTasks.xml if you have it:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectTasksOptions">
    <TaskOptions isEnabled="true">
      <option name="arguments" value="&quot;&amp; $ProjectFileDir$\bin\deploy.ps1&quot;" />
      <option name="checkSyntaxErrors" value="true" />
      <option name="description" />
      <option name="exitCodeBehavior" value="ERROR" />
      <option name="fileExtension" value="*" />
      <option name="immediateSync" value="false" />
      <option name="name" value="Deploy to ESO AddOns" />
      <option name="output" value="" />
      <option name="outputFilters">
        <array />
      </option>
      <option name="outputFromStdout" value="false" />
      <option name="program" value="powershell.exe" />
      <option name="runOnExternalChanges" value="true" />
      <option name="scopeName" value="Project Files" />
      <option name="trackOnlyRoot" value="false" />
      <option name="workingDir" value="$ProjectFileDir$" />
      <envs />
    </TaskOptions>
  </component>
</project>
Here's what it looks like in WebStorm if you want to create it manually:



I'm planning to use this to publish new releases of my add-on through Azure Pipelines. (Massive overkill unless you already have an Azure DevOps setup, though, but I'll let you know when I get that far, as the approach should also be possible with GitHub Actions.)

If you have questions, let me know.
  Reply With Quote
05/03/20, 07:32 AM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Thanks!
Never used Webstorm so far, need to read about it first.

Hint: If you use UTF-8 for your files be sure to remove the BOM or ESO will freak out in the addon manager, sometimes at least. Especially if it's set within the txt manifest files.
  Reply With Quote
05/03/20, 08:38 AM   #8
Aenathel
 
Aenathel's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2020
Posts: 8
Originally Posted by Baertram View Post
Thanks!
Never used Webstorm so far, need to read about it first.
It's a web IDE built in IntelliJ IDEA. It's perfect for my hobby projects.

Originally Posted by Baertram View Post
Hint: If you use UTF-8 for your files be sure to remove the BOM or ESO will freak out in the addon manager, sometimes at least. Especially if it's set within the txt manifest files.
I took care of that on line 10:

Code:
$PSDefaultParameterValues['Out-File:Encoding'] = "utf8"
Of course, this requires PowerShell 5.1, but I'd be surprised if you didn't have that.
  Reply With Quote
05/03/20, 09:11 AM   #9
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
built in IntelliJ IDEA
Cool, working with IntelliJ myself.
Haven't build any web content for years but wanted to start with something to keep learning soon.
Definately need to take a look! Thanks

Edit:
Is it somehow free to use or do I need to buy it? Just saw there is only a 30 days test version available.

I've found threads that Webstorm is included into IntelliJ but my guess it's only in the ultimate version?
The community version does not support JavaScript afaik and found online.

Last edited by Baertram : 05/03/20 at 09:23 AM.
  Reply With Quote
05/03/20, 10:50 AM   #10
Aenathel
 
Aenathel's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2020
Posts: 8
Originally Posted by Baertram View Post
Cool, working with IntelliJ myself.
Haven't build any web content for years but wanted to start with something to keep learning soon.
Definately need to take a look! Thanks
You're welcome! It's quite nice, I primarily use PhpStorm and Rider at work (I have a JetBrains Toolbox subscription with all their programs included), but use WebStorm at home because it's cheaper.

Originally Posted by Baertram View Post
Edit:
Is it somehow free to use or do I need to buy it? Just saw there is only a 30 days test version available.
There are various discounts and offers available.

Originally Posted by Baertram View Post
I've found threads that Webstorm is included into IntelliJ but my guess it's only in the ultimate version?
The community version does not support JavaScript afaik and found online.
Yeah, you need IntelliJ IDEA Ultimate for that, which is about 3x as expensive as WebStorm. WebStorm doesn't have as much language support as IntelliJ IDEA Ultimate, though, it looks like the Lua support is limited, but as Lua isn't my primary reason for having WebStorm, that is fine for me.

A free alternative that you might have heard of is Visual Studio Code. It has extensions for almost anything these days and runs quite well. If I hadn't been spoiled by JetBrains products, that's what I would use.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » How to prevent Minion from overriding the development version of my add-on?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off