From 88c72442dccb305b78ae3a4967995fec70f9e12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belin?= Date: Mon, 26 Aug 2024 15:11:47 +0200 Subject: [PATCH] Give the process a friendly name --- bin/setup_ant.js | 2 +- src/setup_ant/Program.hx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/setup_ant.js b/bin/setup_ant.js index d70b3b1..13d0a26 100755 --- a/bin/setup_ant.js +++ b/bin/setup_ant.js @@ -62,4 +62,4 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}T.g `);for(let s of r){let i=s.split("=");if(i.length===2&&(i[0].trim()==="VERSION_ID"||i[0].trim()==="DISTRIB_RELEASE")){e=i[1].trim().replace(/^"/,"").replace(/"$/,"");break}}}}return e}ce._getOsVersion=ML;function _L(){let A="/etc/lsb-release",e="/etc/os-release",t="";return aa.existsSync(A)?t=aa.readFileSync(A).toString():aa.existsSync(e)&&(t=aa.readFileSync(e).toString()),t}ce._readLinuxVersionFile=_L});var wd=w((CY,pd)=>{var YL=require("crypto");pd.exports=function(){return YL.randomBytes(16)}});var Dd=w((uY,md)=>{var yd=[];for(Xi=0;Xi<256;++Xi)yd[Xi]=(Xi+256).toString(16).substr(1);var Xi;function TL(A,e){var t=e||0,r=yd;return[r[A[t++]],r[A[t++]],r[A[t++]],r[A[t++]],"-",r[A[t++]],r[A[t++]],"-",r[A[t++]],r[A[t++]],"-",r[A[t++]],r[A[t++]],"-",r[A[t++]],r[A[t++]],r[A[t++]],r[A[t++]],r[A[t++]],r[A[t++]]].join("")}md.exports=TL});var Nd=w((BY,Rd)=>{var vL=wd(),JL=Dd();function GL(A,e,t){var r=e&&t||0;typeof A=="string"&&(e=A==="binary"?new Array(16):null,A=null),A=A||{};var s=A.random||(A.rng||vL)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e)for(var i=0;i<16;++i)e[r+i]=s[i];return e||JL(s)}Rd.exports=GL});var bd=w(xe=>{"use strict";var HL=xe&&xe.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),VL=xe&&xe.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),$s=xe&&xe.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&HL(e,A,t);return VL(e,A),e},kd=xe&&xe.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function c(Q){try{l(r.next(Q))}catch(h){o(h)}}function g(Q){try{l(r.throw(Q))}catch(h){o(h)}}function l(Q){Q.done?i(Q.value):s(Q.value).then(c,g)}l((r=r.apply(A,e||[])).next())})};Object.defineProperty(xe,"__esModule",{value:!0});xe.argStringToArray=xe.ToolRunner=void 0;var ca=$s(require("os")),Fd=$s(require("events")),qL=$s(require("child_process")),OL=$s(require("path")),WL=$s(PE()),Sd=$s(OE()),PL=require("timers"),ga=process.platform==="win32",sl=class extends Fd.EventEmitter{constructor(e,t,r){if(super(),!e)throw new Error("Parameter 'toolPath' cannot be null or empty.");this.toolPath=e,this.args=t||[],this.options=r||{}}_debug(e){this.options.listeners&&this.options.listeners.debug&&this.options.listeners.debug(e)}_getCommandString(e,t){let r=this._getSpawnFileName(),s=this._getSpawnArgs(e),i=t?"":"[command]";if(ga)if(this._isCmdFile()){i+=r;for(let o of s)i+=` ${o}`}else if(e.windowsVerbatimArguments){i+=`"${r}"`;for(let o of s)i+=` ${o}`}else{i+=this._windowsQuoteCmdArg(r);for(let o of s)i+=` ${this._windowsQuoteCmdArg(o)}`}else{i+=r;for(let o of s)i+=` ${o}`}return i}_processLineBuffer(e,t,r){try{let s=t+e.toString(),i=s.indexOf(ca.EOL);for(;i>-1;){let o=s.substring(0,i);r(o),s=s.substring(i+ca.EOL.length),i=s.indexOf(ca.EOL)}return s}catch(s){return this._debug(`error processing line. Failed with error ${s}`),""}}_getSpawnFileName(){return ga&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath}_getSpawnArgs(e){if(ga&&this._isCmdFile()){let t=`/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;for(let r of this.args)t+=" ",t+=e.windowsVerbatimArguments?r:this._windowsQuoteCmdArg(r);return t+='"',[t]}return this.args}_endsWith(e,t){return e.endsWith(t)}_isCmdFile(){let e=this.toolPath.toUpperCase();return this._endsWith(e,".CMD")||this._endsWith(e,".BAT")}_windowsQuoteCmdArg(e){if(!this._isCmdFile())return this._uvQuoteCmdArg(e);if(!e)return'""';let t=[" "," ","&","(",")","[","]","{","}","^","=",";","!","'","+",",","`","~","|","<",">",'"'],r=!1;for(let o of e)if(t.some(c=>c===o)){r=!0;break}if(!r)return e;let s='"',i=!0;for(let o=e.length;o>0;o--)s+=e[o-1],i&&e[o-1]==="\\"?s+="\\":e[o-1]==='"'?(i=!0,s+='"'):i=!1;return s+='"',s.split("").reverse().join("")}_uvQuoteCmdArg(e){if(!e)return'""';if(!e.includes(" ")&&!e.includes(" ")&&!e.includes('"'))return e;if(!e.includes('"')&&!e.includes("\\"))return`"${e}"`;let t='"',r=!0;for(let s=e.length;s>0;s--)t+=e[s-1],r&&e[s-1]==="\\"?t+="\\":e[s-1]==='"'?(r=!0,t+="\\"):r=!1;return t+='"',t.split("").reverse().join("")}_cloneExecOptions(e){e=e||{};let t={cwd:e.cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,delay:e.delay||1e4};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t}_getSpawnOptions(e,t){e=e||{};let r={};return r.cwd=e.cwd,r.env=e.env,r.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),e.windowsVerbatimArguments&&(r.argv0=`"${t}"`),r}exec(){return kd(this,void 0,void 0,function*(){return!Sd.isRooted(this.toolPath)&&(this.toolPath.includes("/")||ga&&this.toolPath.includes("\\"))&&(this.toolPath=OL.resolve(process.cwd(),this.options.cwd||process.cwd(),this.toolPath)),this.toolPath=yield WL.which(this.toolPath,!0),new Promise((e,t)=>kd(this,void 0,void 0,function*(){this._debug(`exec tool: ${this.toolPath}`),this._debug("arguments:");for(let l of this.args)this._debug(` ${l}`);let r=this._cloneExecOptions(this.options);!r.silent&&r.outStream&&r.outStream.write(this._getCommandString(r)+ca.EOL);let s=new il(r,this.toolPath);if(s.on("debug",l=>{this._debug(l)}),this.options.cwd&&!(yield Sd.exists(this.options.cwd)))return t(new Error(`The cwd: ${this.options.cwd} does not exist!`));let i=this._getSpawnFileName(),o=qL.spawn(i,this._getSpawnArgs(r),this._getSpawnOptions(this.options,i)),c="";o.stdout&&o.stdout.on("data",l=>{this.options.listeners&&this.options.listeners.stdout&&this.options.listeners.stdout(l),!r.silent&&r.outStream&&r.outStream.write(l),c=this._processLineBuffer(l,c,Q=>{this.options.listeners&&this.options.listeners.stdline&&this.options.listeners.stdline(Q)})});let g="";if(o.stderr&&o.stderr.on("data",l=>{s.processStderr=!0,this.options.listeners&&this.options.listeners.stderr&&this.options.listeners.stderr(l),!r.silent&&r.errStream&&r.outStream&&(r.failOnStdErr?r.errStream:r.outStream).write(l),g=this._processLineBuffer(l,g,Q=>{this.options.listeners&&this.options.listeners.errline&&this.options.listeners.errline(Q)})}),o.on("error",l=>{s.processError=l.message,s.processExited=!0,s.processClosed=!0,s.CheckComplete()}),o.on("exit",l=>{s.processExitCode=l,s.processExited=!0,this._debug(`Exit code ${l} received from tool '${this.toolPath}'`),s.CheckComplete()}),o.on("close",l=>{s.processExitCode=l,s.processExited=!0,s.processClosed=!0,this._debug(`STDIO streams have closed for tool '${this.toolPath}'`),s.CheckComplete()}),s.on("done",(l,Q)=>{c.length>0&&this.emit("stdline",c),g.length>0&&this.emit("errline",g),o.removeAllListeners(),l?t(l):e(Q)}),this.options.input){if(!o.stdin)throw new Error("child process missing stdin");o.stdin.end(this.options.input)}}))})}};xe.ToolRunner=sl;function XL(A){let e=[],t=!1,r=!1,s="";function i(o){r&&o!=='"'&&(s+="\\"),s+=o,r=!1}for(let o=0;o0&&(e.push(s),s="");continue}i(c)}return s.length>0&&e.push(s.trim()),e}xe.argStringToArray=XL;var il=class A extends Fd.EventEmitter{constructor(e,t){if(super(),this.processClosed=!1,this.processError="",this.processExitCode=0,this.processExited=!1,this.processStderr=!1,this.delay=1e4,this.done=!1,this.timeout=null,!t)throw new Error("toolPath must not be empty");this.options=e,this.toolPath=t,e.delay&&(this.delay=e.delay)}CheckComplete(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=PL.setTimeout(A.HandleTimeout,this.delay,this)))}_debug(e){this.emit("debug",e)}_setResult(){let e;this.processExited&&(this.processError?e=new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`):this.processExitCode!==0&&!this.options.ignoreReturnCode?e=new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`):this.processStderr&&this.options.failOnStdErr&&(e=new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`))),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",e,this.processExitCode)}static HandleTimeout(e){if(!e.done){if(!e.processClosed&&e.processExited){let t=`The STDIO streams did not close within ${e.delay/1e3} seconds of the exit event from process '${e.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;e._debug(t)}e._setResult()}}}});var _d=w(Me=>{"use strict";var ZL=Me&&Me.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),jL=Me&&Me.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),KL=Me&&Me.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&ZL(e,A,t);return jL(e,A),e},xd=Me&&Me.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function c(Q){try{l(r.next(Q))}catch(h){o(h)}}function g(Q){try{l(r.throw(Q))}catch(h){o(h)}}function l(Q){Q.done?i(Q.value):s(Q.value).then(c,g)}l((r=r.apply(A,e||[])).next())})};Object.defineProperty(Me,"__esModule",{value:!0});Me.getExecOutput=Me.exec=void 0;var Ud=require("string_decoder"),Ld=KL(bd());function Md(A,e,t){return xd(this,void 0,void 0,function*(){let r=Ld.argStringToArray(A);if(r.length===0)throw new Error("Parameter 'commandLine' cannot be null or empty.");let s=r[0];return e=r.slice(1).concat(e||[]),new Ld.ToolRunner(s,e,t).exec()})}Me.exec=Md;function zL(A,e,t){var r,s;return xd(this,void 0,void 0,function*(){let i="",o="",c=new Ud.StringDecoder("utf8"),g=new Ud.StringDecoder("utf8"),l=(r=t?.listeners)===null||r===void 0?void 0:r.stdout,Q=(s=t?.listeners)===null||s===void 0?void 0:s.stderr,h=F=>{o+=g.write(F),Q&&Q(F)},u=F=>{i+=c.write(F),l&&l(F)},I=Object.assign(Object.assign({},t?.listeners),{stdout:u,stderr:h}),f=yield Md(A,e,Object.assign(Object.assign({},t),{listeners:I}));return i+=c.end(),o+=g.end(),{exitCode:f,stdout:i,stderr:o}})}Me.getExecOutput=zL});var vd=w(ct=>{"use strict";var $L=ct&&ct.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),Ax=ct&&ct.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),ex=ct&&ct.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&$L(e,A,t);return Ax(e,A),e},Yd=ct&&ct.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function c(Q){try{l(r.next(Q))}catch(h){o(h)}}function g(Q){try{l(r.throw(Q))}catch(h){o(h)}}function l(Q){Q.done?i(Q.value):s(Q.value).then(c,g)}l((r=r.apply(A,e||[])).next())})};Object.defineProperty(ct,"__esModule",{value:!0});ct.RetryHelper=void 0;var Td=ex(Zs()),nl=class{constructor(e,t,r){if(e<1)throw new Error("max attempts should be greater than or equal to 1");if(this.maxAttempts=e,this.minSeconds=Math.floor(t),this.maxSeconds=Math.floor(r),this.minSeconds>this.maxSeconds)throw new Error("min seconds should be less than or equal to max seconds")}execute(e,t){return Yd(this,void 0,void 0,function*(){let r=1;for(;rsetTimeout(t,e*1e3))})}};ct.RetryHelper=nl});var Pd=w(AA=>{"use strict";var tx=AA&&AA.__createBinding||(Object.create?function(A,e,t,r){r===void 0&&(r=t),Object.defineProperty(A,r,{enumerable:!0,get:function(){return e[t]}})}:function(A,e,t,r){r===void 0&&(r=t),A[r]=e[t]}),rx=AA&&AA.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),Yt=AA&&AA.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(A!=null)for(var t in A)t!=="default"&&Object.hasOwnProperty.call(A,t)&&tx(e,A,t);return rx(e,A),e},de=AA&&AA.__awaiter||function(A,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function c(Q){try{l(r.next(Q))}catch(h){o(h)}}function g(Q){try{l(r.throw(Q))}catch(h){o(h)}}function l(Q){Q.done?i(Q.value):s(Q.value).then(c,g)}l((r=r.apply(A,e||[])).next())})},sx=AA&&AA.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(AA,"__esModule",{value:!0});AA.evaluateVersions=AA.isExplicitVersion=AA.findFromManifest=AA.getManifestFromRepo=AA.findAllVersions=AA.find=AA.cacheFile=AA.cacheDir=AA.extractZip=AA.extractXar=AA.extractTar=AA.extract7z=AA.downloadTool=AA.HTTPError=void 0;var oA=Yt(Zs()),Ze=Yt(PE()),gt=Yt(require("fs")),ix=Yt(dd()),ji=Yt(require("os")),ft=Yt(require("path")),Jd=Yt(UE()),rr=Yt(el()),nx=Yt(require("stream")),ox=Yt(require("util")),Ai=require("assert"),Gd=sx(Nd()),yr=_d(),ax=vd(),Zi=class extends Error{constructor(e){super(`Unexpected HTTP response: ${e}`),this.httpStatusCode=e,Object.setPrototypeOf(this,new.target.prototype)}};AA.HTTPError=Zi;var al=process.platform==="win32",cx=process.platform==="darwin",gx="actions/tool-cache";function Ex(A,e,t,r){return de(this,void 0,void 0,function*(){e=e||ft.join(Wd(),Gd.default()),yield Ze.mkdirP(ft.dirname(e)),oA.debug(`Downloading ${A}`),oA.debug(`Destination ${e}`);let s=3,i=ol("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS",10),o=ol("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS",20);return yield new ax.RetryHelper(s,i,o).execute(()=>de(this,void 0,void 0,function*(){return yield lx(A,e||"",t,r)}),g=>!(g instanceof Zi&&g.httpStatusCode&&g.httpStatusCode<500&&g.httpStatusCode!==408&&g.httpStatusCode!==429))})}AA.downloadTool=Ex;function lx(A,e,t,r){return de(this,void 0,void 0,function*(){if(gt.existsSync(e))throw new Error(`Destination file path ${e} already exists`);let s=new Jd.HttpClient(gx,[],{allowRetries:!1});t&&(oA.debug("set auth"),r===void 0&&(r={}),r.authorization=t);let i=yield s.get(A,r);if(i.message.statusCode!==200){let Q=new Zi(i.message.statusCode);throw oA.debug(`Failed to download from "${A}". Code(${i.message.statusCode}) Message(${i.message.statusMessage})`),Q}let o=ox.promisify(nx.pipeline),g=ol("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY",()=>i.message)(),l=!1;try{return yield o(g,gt.createWriteStream(e)),oA.debug("download complete"),l=!0,e}finally{if(!l){oA.debug("download failed");try{yield Ze.rmRF(e)}catch(Q){oA.debug(`Failed to delete '${e}'. ${Q.message}`)}}}})}function Qx(A,e,t){return de(this,void 0,void 0,function*(){Ai.ok(al,"extract7z() not supported on current OS"),Ai.ok(A,'parameter "file" is required'),e=yield Ea(e);let r=process.cwd();if(process.chdir(e),t)try{let i=["x",oA.isDebug()?"-bb1":"-bb0","-bd","-sccUTF-8",A],o={silent:!0};yield yr.exec(`"${t}"`,i,o)}finally{process.chdir(r)}else{let s=ft.join(__dirname,"..","scripts","Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,""),i=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),o=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),g=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",`& '${s}' -Source '${i}' -Target '${o}'`],l={silent:!0};try{let Q=yield Ze.which("powershell",!0);yield yr.exec(`"${Q}"`,g,l)}finally{process.chdir(r)}}return e})}AA.extract7z=Qx;function hx(A,e,t="xz"){return de(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");e=yield Ea(e),oA.debug("Checking tar --version");let r="";yield yr.exec("tar --version",[],{ignoreReturnCode:!0,silent:!0,listeners:{stdout:g=>r+=g.toString(),stderr:g=>r+=g.toString()}}),oA.debug(r.trim());let s=r.toUpperCase().includes("GNU TAR"),i;t instanceof Array?i=t:i=[t],oA.isDebug()&&!t.includes("v")&&i.push("-v");let o=e,c=A;return al&&s&&(i.push("--force-local"),o=e.replace(/\\/g,"/"),c=A.replace(/\\/g,"/")),s&&(i.push("--warning=no-unknown-keyword"),i.push("--overwrite")),i.push("-C",o,"-f",c),yield yr.exec("tar",i),e})}AA.extractTar=hx;function Cx(A,e,t=[]){return de(this,void 0,void 0,function*(){Ai.ok(cx,"extractXar() not supported on current OS"),Ai.ok(A,'parameter "file" is required'),e=yield Ea(e);let r;t instanceof Array?r=t:r=[t],r.push("-x","-C",e,"-f",A),oA.isDebug()&&r.push("-v");let s=yield Ze.which("xar",!0);return yield yr.exec(`"${s}"`,mx(r)),e})}AA.extractXar=Cx;function ux(A,e){return de(this,void 0,void 0,function*(){if(!A)throw new Error("parameter 'file' is required");return e=yield Ea(e),al?yield Bx(A,e):yield Ix(A,e),e})}AA.extractZip=ux;function Bx(A,e){return de(this,void 0,void 0,function*(){let t=A.replace(/'/g,"''").replace(/"|\n|\r/g,""),r=e.replace(/'/g,"''").replace(/"|\n|\r/g,""),s=yield Ze.which("pwsh",!1);if(s){let o=["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;",`try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`,`catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force } else { throw $_ } } ;`].join(" ")];oA.debug(`Using pwsh at path: ${s}`),yield yr.exec(`"${s}"`,o)}else{let o=["-NoLogo","-Sta","-NoProfile","-NonInteractive","-ExecutionPolicy","Unrestricted","-Command",["$ErrorActionPreference = 'Stop' ;","try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;",`if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${t}' -DestinationPath '${r}' -Force }`,`else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${t}', '${r}', $true) }`].join(" ")],c=yield Ze.which("powershell",!0);oA.debug(`Using powershell at path: ${c}`),yield yr.exec(`"${c}"`,o)}})}function Ix(A,e){return de(this,void 0,void 0,function*(){let t=yield Ze.which("unzip",!0),r=[A];oA.isDebug()||r.unshift("-q"),r.unshift("-o"),yield yr.exec(`"${t}"`,r,{cwd:e})})}function fx(A,e,t,r){return de(this,void 0,void 0,function*(){if(t=rr.clean(t)||t,r=r||ji.arch(),oA.debug(`Caching tool ${e} ${t} ${r}`),oA.debug(`source dir: ${A}`),!gt.statSync(A).isDirectory())throw new Error("sourceDir is not a directory");let s=yield Vd(e,t,r);for(let i of gt.readdirSync(A)){let o=ft.join(A,i);yield Ze.cp(o,s,{recursive:!0})}return qd(e,t,r),s})}AA.cacheDir=fx;function dx(A,e,t,r,s){return de(this,void 0,void 0,function*(){if(r=rr.clean(r)||r,s=s||ji.arch(),oA.debug(`Caching tool ${t} ${r} ${s}`),oA.debug(`source file: ${A}`),!gt.statSync(A).isFile())throw new Error("sourceFile is not a file");let i=yield Vd(t,r,s),o=ft.join(i,e);return oA.debug(`destination file ${o}`),yield Ze.cp(A,o),qd(t,r,s),i})}AA.cacheFile=dx;function px(A,e,t){if(!A)throw new Error("toolName parameter is required");if(!e)throw new Error("versionSpec parameter is required");if(t=t||ji.arch(),!cl(e)){let s=Hd(A,t);e=Od(s,e)}let r="";if(e){e=rr.clean(e)||"";let s=ft.join(la(),A,e,t);oA.debug(`checking cache: ${s}`),gt.existsSync(s)&>.existsSync(`${s}.complete`)?(oA.debug(`Found tool in cache ${A} ${e} ${t}`),r=s):oA.debug("not found")}return r}AA.find=px;function Hd(A,e){let t=[];e=e||ji.arch();let r=ft.join(la(),A);if(gt.existsSync(r)){let s=gt.readdirSync(r);for(let i of s)if(cl(i)){let o=ft.join(r,i,e||"");gt.existsSync(o)&>.existsSync(`${o}.complete`)&&t.push(i)}}return t}AA.findAllVersions=Hd;function wx(A,e,t,r="master"){return de(this,void 0,void 0,function*(){let s=[],i=`https://api.github.com/repos/${A}/${e}/git/trees/${r}`,o=new Jd.HttpClient("tool-cache"),c={};t&&(oA.debug("set auth"),c.authorization=t);let g=yield o.getJson(i,c);if(!g.result)return s;let l="";for(let h of g.result.tree)if(h.path==="versions-manifest.json"){l=h.url;break}c.accept="application/vnd.github.VERSION.raw";let Q=yield(yield o.get(l,c)).readBody();if(Q){Q=Q.replace(/^\uFEFF/,"");try{s=JSON.parse(Q)}catch{oA.debug("Invalid json")}}return s})}AA.getManifestFromRepo=wx;function yx(A,e,t,r=ji.arch()){return de(this,void 0,void 0,function*(){return yield ix._findMatch(A,e,t,r)})}AA.findFromManifest=yx;function Ea(A){return de(this,void 0,void 0,function*(){return A||(A=ft.join(Wd(),Gd.default())),yield Ze.mkdirP(A),A})}function Vd(A,e,t){return de(this,void 0,void 0,function*(){let r=ft.join(la(),A,rr.clean(e)||e,t||"");oA.debug(`destination ${r}`);let s=`${r}.complete`;return yield Ze.rmRF(r),yield Ze.rmRF(s),yield Ze.mkdirP(r),r})}function qd(A,e,t){let s=`${ft.join(la(),A,rr.clean(e)||e,t||"")}.complete`;gt.writeFileSync(s,""),oA.debug("finished caching tool")}function cl(A){let e=rr.clean(A)||"";oA.debug(`isExplicit: ${e}`);let t=rr.valid(e)!=null;return oA.debug(`explicit? ${t}`),t}AA.isExplicitVersion=cl;function Od(A,e){let t="";oA.debug(`evaluating ${A.length} versions`),A=A.sort((r,s)=>rr.gt(r,s)?1:-1);for(let r=A.length-1;r>=0;r--){let s=A[r];if(rr.satisfies(s,e)){t=s;break}}return t?oA.debug(`matched: ${t}`):oA.debug("match not found"),t}AA.evaluateVersions=Od;function la(){let A=process.env.RUNNER_TOOL_CACHE||"";return Ai.ok(A,"Expected RUNNER_TOOL_CACHE to be defined"),A}function Wd(){let A=process.env.RUNNER_TEMP||"";return Ai.ok(A,"Expected RUNNER_TEMP to be defined"),A}function ol(A,e){let t=global[A];return t!==void 0?t:e}function mx(A){return Array.from(new Set(A))}});(function(A){"use strict";var e=function(){return LA.__string_rec(this,"")},t=t||{},r;class s{constructor(n,a){this.r=new RegExp(n,a.split("u").join(""))}match(n){return this.r.global&&(this.r.lastIndex=0),this.r.m=this.r.exec(n),this.r.s=n,this.r.m!=null}matched(n){if(this.r.m!=null&&n>=0&&n8&&E<14?!0:E==32}static ltrim(n){let a=n.length,E=0;for(;E0?i.substr(n,E,a-E):n}static rtrim(n){let a=n.length,E=0;for(;E0?i.substr(n,0,a-E):n}static trim(n){return l.ltrim(l.rtrim(n))}static replace(n,a,E){return n.split(a).join(E)}static hex(n,a){let E="";do E="0123456789ABCDEF".charAt(n&15)+E,n>>>=4;while(n>0);if(a!=null)for(;E.lengththis.length)throw I.thrown(fA.OutsideBounds);E==null&&(E=b.UTF8);let C="",B=this.b,p=n,m=n+a;switch(E._hx_index){case 0:for(;p>8}return new N(B.buffer)}let E=[],C=0;for(;C>6),E.push(128|B&63)):B<=65535?(E.push(224|B>>12),E.push(128|B>>6&63),E.push(128|B&63)):(E.push(240|B>>18),E.push(128|B>>12&63),E.push(128|B>>6&63),E.push(128|B&63))}return new N(new Uint8Array(E).buffer)}}N.__name__=!0;var b=t["haxe.io.Encoding"]={__ename__:!0,__constructs__:null,UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding",toString:e},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding",toString:e}};b.__constructs__=[b.UTF8,b.RawNative];class x{static decode(n,a){if(a==null&&(a=!0),a)for(;i.cca(n,n.length-1)==61;)n=i.substr(n,0,-1);return new O(x.BYTES).decodeBytes(N.ofString(n))}}x.__name__=!0;class O{constructor(n){let a=n.length,E=1;for(;a>1<8||a!=1<>3,B=new N(new ArrayBuffer(C)),p=0,m=0,R=0,L=0;for(;L>m&255}return B}}O.__name__=!0;class K{constructor(){this.h={}}}K.__name__=!0;class qA{constructor(){this.h={__keys__:{}}}}qA.__name__=!0;var y=t["haxe.ds.Option"]={__ename__:!0,__constructs__:null,Some:(r=function(k){return{_hx_index:0,v:k,__enum__:"haxe.ds.Option",toString:e}},r._hx_name="Some",r.__params__=["v"],r),None:{_hx_name:"None",_hx_index:1,__enum__:"haxe.ds.Option",toString:e}};y.__constructs__=[y.Some,y.None];var fA=t["haxe.io.Error"]={__ename__:!0,__constructs__:null,Blocked:{_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error",toString:e},Overflow:{_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error",toString:e},OutsideBounds:{_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error",toString:e},Custom:(r=function(k){return{_hx_index:3,e:k,__enum__:"haxe.io.Error",toString:e}},r._hx_name="Custom",r.__params__=["e"],r)};fA.__constructs__=[fA.Blocked,fA.Overflow,fA.OutsideBounds,fA.Custom];class yA{static join(n){let a=[],E=0;for(;E0&&E[E.length-1]!=".."?E.pop():mA==""?(E.length>0||i.cca(n,0)==47)&&E.push(mA):mA!="."&&E.push(mA)}let p="",m=!1,R=!1,L=0,Z=E.join(a);for(;L=55296&&Ye<=56319&&(Ye=Ye-55232<<10|mA.charCodeAt(ge+1)&1023);let Te=Ye;Te>=65536&&++L;let me=Te;switch(me){case 47:if(!m)R=!0;else{let en=me;m=!1,R&&(p+="/",R=!1),p+=String.fromCodePoint(en)}break;case 58:p+=":",m=!0;break;default:let Nr=me;m=!1,R&&(p+="/",R=!1),p+=String.fromCodePoint(Nr)}}return p}static addTrailingSlash(n){if(n.length==0)return"/";let a=n.lastIndexOf("/"),E=n.lastIndexOf("\\");return a=5)return"<...>";let E=typeof n;switch(E=="function"&&(n.__name__||n.__ename__)&&(E="object"),E){case"function":return"";case"object":if(n.__enum__){let L=t[n.__enum__].__constructs__[n._hx_index],Z=L._hx_name;return L.__params__?(a=a+" ",Z+"("+function(mA){var ge;let Ye=[];{let Te=0,me=L.__params__;for(;Te0?",":"")+LA.__string_rec(n[mA],a)}return R+="]",R}let C;try{C=n.toString}catch{return"???"}if(C!=null&&C!=Object.toString&&typeof C=="function"){let R=n.toString();if(R!="[object Object]")return R}let B=`{ `;a+=" ";let p=n.hasOwnProperty!=null,m=null;for(m in n)p&&!n.hasOwnProperty(m)||m=="prototype"||m=="__class__"||m=="__super__"||m=="__interfaces__"||m=="__properties__"||(B.length!=2&&(B+=`, `),B+=a+m+" : "+LA.__string_rec(n[m],a));return a=a.substring(1),B+=` -`+a+"}",B;case"string":return n;default:return String(n)}}}LA.__name__=!0;var xA=Zs(),rA=Pd(),kA=require("child_process"),zA=require("fs");function dt(){let k=xA.getBooleanInput("optional-tasks"),n=xA.getInput("version"),a=XA.parse(n.length==0||n=="latest"?"*":n);switch(a._hx_index){case 0:let E=OA.find(a.data);switch(E._hx_index){case 0:let C=E.v;new Ke(C).install(k).handle(function(B){switch(B._hx_index){case 0:xA.info("Apache Ant "+C.version+" successfully "+(k?"installed with optional tasks":"installed")+' in "'+B.data+'".');break;case 1:xA.setFailed(B.failure.message);break}});break;case 1:xA.setFailed("No release matching the version constraint.");break}break;case 1:xA.setFailed("Invalid version constraint.");break}}class MA{static resolve(n,a){if(a.scheme!=null)return a;if(a.hosts[0]!=null){if(a.scheme!=null)return a;{let E=c.copy(a);return E.scheme=n.scheme,E}}else{let E={path:Et.join(n.path,a.path),payload:"",scheme:n.scheme,query:a.query,auth:n.auth,hosts:n.hosts,hash:a.hash};return MA.makePayload(E),E}}static makePayload(n){let a="",E=n.auth,C=n.hosts;E==null?C.length!=0&&(a="//"+C.join(",")):C.length==0?a="//"+(E==null?"null":E==null?"":""+E+"@"):a="//"+(E==null?"null":E==null?"":""+E+"@")+C.join(","),a+=n.path==null?"null":n.path;let B=n.query;B!=null&&(a+="?"+(B??"null"));let p=n.hash;p!=null&&(a+="#"+p),n.payload=a.toString()}static toString(n){return n.scheme==null?n.payload:""+n.scheme+":"+n.payload}static fromString(n){return MA.parse(n)}static noop(n){}static parse(n,a){for(;;){if(n==null){n="",a=null;continue}if(a==null&&(a=MA.noop),n=l.trim(n),n.startsWith("data:"))return{scheme:"data",payload:i.substr(n,5,null),hosts:[]};let E=new s("^(([a-zA-Z][a-zA-Z0-9\\-+.]*):)?((//(([^@/]+)@)?([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?)$",""),C=new s("^(\\[(.*)\\]|([^:]*))(:(.*))?$","");E.match(n);let B,p=E.matched(7);if(p==null)B=[];else{let R=[],L=0,Z=p.split(",");for(;L0&&m.charAt(0)!="/"&&(m="/"+m),{scheme:E.matched(2),payload:E.matched(3),hosts:B,auth:E.matched(6),path:Et.ofString(m),query:E.matched(10),hash:E.matched(12)}}}}class Kr{static _new(n,a){let E;if(a==null)E=n;else{if(a>65535||a<=0)throw I.thrown("Invalid port");E=""+n+":"+a}return E}}class Et{static join(n,a){if(a=="")return n;if(a.charAt(0)=="/")return a;if(n.charAt(n.length-1)=="/")return Et.ofString(n+a);{let E=n.lastIndexOf("/");return E==-1?a:Et.ofString(i.substr(n,0,E+1)+(a??"null"))}}static ofString(n){return Et.normalize(n)}static normalize(n){if(n=l.trim(l.replace(n,"\\","/")),n==".")return"./";let a=n.endsWith("/..")||n.endsWith("/")||n.endsWith("/."),E=[],C=n.startsWith("/"),B=0,p=0,m=n.split("/");for(;p0;){let C=E.next();if(a==null||a(C))return y.Some(C)}return y.None}static fromArray(n){let a=null,E=0,C=n.length;for(;C-- >0;)a=new je(++E,n[C],a==null?je.EMPTY:[a]);return a}}class je{constructor(n,a,E){this.value=a,this.length=n,this.tails=E??je.EMPTY}}je.__name__=!0;class Tt{constructor(){this.afterParsing=[],this.plugins=new JA(this)}init(n){for(this.pos=0,this.max=n.length,this.source=n;this.source.charCodeAt(this.pos)<33;)this.pos++}parseString(){for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let n;return this.source.charCodeAt(this.pos)==34?(this.pos+=1,n=!0):n=!1,n||this.die("Expected string"),this.parseRestOfString()}parseRestOfString(){return this.slice(this.skipString(),this.pos-1)}skipString(){let n=this.pos;for(;;){let a=this.source.indexOf(Tt.DBQT,this.pos);if(a==-1)this.die("unterminated string",n);else{this.pos=a+1;let E=this.pos-2;for(;this.source.charCodeAt(E)==92;)--E;if(!(E-this.pos&1))break}}return n}invalidNumber(n){return this.die("Invalid number "+this.source.substring(n,this.pos),n)}skipNumber(n){let a=this.pos-1,E=n==45,C=!E,B=n==48,p=!1,m=!1,R=!1,L=!1;for(;this.pos47?this.skipNumber(n):this.invalidChar(n)}}invalidChar(n){return this.die("invalid char "+l.hex(n,2),this.pos-1)}die(n,a,E){E==null&&(E=-1),a==null&&(a=-1),a==-1?(a=this.pos,E=a):E==-1&&(E=this.pos),E<=a&&(E=a+1);let C=function(p,m,R){return p.length>m?R?"... "+i.substr(p,p.length-m,null):i.substr(p,0,m)+" ...":p},B=a+E>>1;return $A.withData(422,n+(" at "+(E>a+1?"characters "+a+" - "+E:"character "+a)+" in "+(C(this.source.substring(0,a),20,!0)+" ----> "+C(this.source.substring(a,B),20,!1)+C(this.source.substring(B,E),20,!0)+" <---- "+C(this.source.substring(E,this.max),20,!1))),{source:this.source,start:a,end:E},{fileName:"tink/json/Parser.hx",lineNumber:472,className:"tink.json.BasicParser",methodName:"die"}).throwSelf()}}Tt.__name__=!0;class zr extends Tt{constructor(){super()}process0(){let n=this,a=0,E=null,C=this.pos;for(;;){let p=this.source.charCodeAt(this.pos++),m;if(p==123)break;m=p<33,m!=!0&&this.die("expected {")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let B;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;B=!0}else B=!1;if(!B){for(;;){for(;;){let R=this.source.charCodeAt(this.pos++),L;if(R==34)break;L=R<33,L!=!0&&this.die('expected "')}if(a=this.source.charCodeAt(this.pos++),a==118&&(a=this.source.charCodeAt(this.pos++),a==101&&(a=this.source.charCodeAt(this.pos++),a==114&&(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==105&&(a=this.source.charCodeAt(this.pos++),a==111&&(a=this.source.charCodeAt(this.pos++),a==110&&(a=this.source.charCodeAt(this.pos++),a==34)))))))){for(;;){let Z=this.source.charCodeAt(this.pos++),mA;if(Z==58)break;mA=Z<33,mA!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;R=!0}else R=!1;if(R)E=null;else{let Z=this.parseString();E=Z.indexOf(Ql.BACKSLASH)==-1?Z:JSON.parse('"'+Z+'"')}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,L=!0):L=!1,L)continue;break}for(a!=34&&this.skipString();;){let R=this.source.charCodeAt(this.pos++),L;if(R==58)break;L=R<33,L!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(this.skipValue();this.source.charCodeAt(this.pos)<33;)this.pos++;let m;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,m=!0):m=!1,!m)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let p;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;p=!0}else p=!1;p||this.die("Expected }")}return{version:E}}parse(n){for(this.afterParsing.length>0&&(this.afterParsing=[]),this.init(n);this.source.charCodeAt(this.pos)<33;)this.pos++;let a;if(this.source.charCodeAt(this.pos)==91){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;a=!0}else a=!1;a||this.die("Expected [");let E=[];for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let C;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;C=!0}else C=!1;if(!C){for(;;){for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;R=!0}else R=!1;for(E.push(new OA(R?null:this.process0()));this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==44){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;L=!0}else L=!1;if(!L)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let m;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;m=!0}else m=!1;m||this.die("Expected ]")}let B=0,p=this.afterParsing;for(;B0&&(this.afterParsing=[]),E}}zr.__name__=!0;class JA{constructor(n){this.target=n,this.registry=new qA}}JA.__name__=!0;class OA{constructor(n){n==null&&(n={});let a=this,E=ZA.cur;ZA.cur=null;let C=new ZA(fa.sync(function(){return MA.resolve(OA.baseUrl,MA.fromString("apache-ant-"+a.version+"-bin.zip"))}),null,null);ZA.cur=E,this.__coco_url=C;let B=ZA.cur;ZA.cur=null;let p=new ZA(fa.sync(function(){let R=!1,L=new Ba(OA.data);for(;L.list.length>0;)if(L.next().version==a.version){R=!0;break}return R}),null,null);ZA.cur=B,this.__coco_exists=p;let m=n.version;this.version=m??"0.0.0",this.__coco_transitionCount=zd._new(0),this.errorTrigger=Zd.trigger(),this.transitionErrors=this.errorTrigger,this.annex=new h(this),this.observables={exists:this.__coco_exists,url:this.__coco_url,version:new ul(this.version,null),isInTransition:Dr.map(this.__coco_transitionCount,Kd.plain(function(R){return R>0}))}}static find(n){return sr.first(OA.data,function(a){return XA.matches(n,$i.sure(v.parse(a.version)))})}}OA.__name__=!0;class Ke{constructor(n){this.release=n}download(n){n==null&&(n=!1);let a=this;return $r.next($r.next($r.next(Gt.ofJsPromise(rA.downloadTool(MA.toString(Dr.get_value(this.release.__coco_url)))),function(E){return Gt.ofJsPromise(rA.extractZip(E))}),function(E){return $i.next(a.findSubfolder(E),function(C){return new Jt(new pt(SA.Success(a.normalizeSeparator(yA.join([E,C])))))})}),function(E){return n?$r.next(a.fetchOptionalTasks(E),function(C){return new Jt(new pt(SA.Success(E)))}):new Jt(new pt(SA.Success(E)))})}install(n){n==null&&(n=!1);let a=rA.find("ant",this.release.version),E=this,C=a.length>0?new Jt(new pt(SA.Success(a))):$r.next(this.download(n),function(B){return Gt.ofJsPromise(rA.cacheDir(B,"ant",E.release.version))});return $r.next(C,function(B){let p=E.normalizeSeparator(B);return xA.addPath(E.normalizeSeparator(yA.join([B,"bin"]))),xA.exportVariable("ANT_HOME",p),new Jt(new pt(SA.Success(p)))})}fetchOptionalTasks(n){let a=yA.addTrailingSlash(process.cwd());return n==null?c.deleteField(process.env,"ANT_HOME"):process.env.ANT_HOME=n,process.chdir(n),kA.spawnSync("ant -buildfile fetch.xml -noinput -silent -Ddest=system",{shell:!0,stdio:"inherit"}),process.chdir(a),new Jt(new pt(SA.Success(null)))}findSubfolder(n){let a=zA.readdirSync(n),E=[],C=0;for(;C>1&&n.compact()}}}ha.__name__=!0;class ir{constructor(n){ir._hx_skip_constructor||this._hx_constructor(n)}_hx_constructor(n){this.disposeHandlers=[],this.f=n}dispose(){let n=this.disposeHandlers;if(n!=null){this.disposeHandlers=null;let a=this.f;this.f=ir.noop,a();let E=0;for(;E0){this.used=0;let E=this.ondrain;hA.depth<500?(hA.depth++,E(),hA.depth--):hA.defer(E)}}invoke(n){let a=this;if(hA.depth<500){if(hA.depth++,a.disposeHandlers!=null)if(a.busy){if(a.destructive!=!0){let E=a,C=n,B=function(){E.invoke(C)};a.queue.push(B)}}else{a.busy=!0,a.destructive&&a.dispose();let E=a.cells.length,C=0;for(;C0&&a.queue.shift()())}hA.depth--}else hA.defer(function(){if(a.disposeHandlers!=null)if(a.busy){if(a.destructive!=!0){let E=a,C=n,B=function(){E.invoke(C)};a.queue.push(B)}}else{a.busy=!0,a.destructive&&a.dispose();let E=a.cells.length,C=0;for(;C0&&a.queue.shift()())}})}compact(){if(!this.busy)if(this.used==0){this.resize(0);let n=this.ondrain;hA.depth<500?(hA.depth++,n(),hA.depth--):hA.defer(n)}else{let n=0,a=0,E=this.cells.length;for(;a256&&(n=new o(n.min,256));let E=n;for(;E.minn.length?0:a+n.length:a>n.length?n.length:a}static wrap(n,a){return a<0?a+n.length:a}static ofString(n){if(n==null||n=="")return aA.EMPTY;if(n.length==1){let a=n.charCodeAt(0);return an.length)return!1;let C=a;return aA.isEqual(n.string,n.start+E,a.length,C.string,C.start,C.length)}static isEqual(n,a,E,C,B,p){if(p!=E)return!1;let m=0;for(;m0}next(){let n=this.list.pop();if(n==null)return null;{let a=-n.tails.length;for(;a<0;)this.list.push(n.tails[-a++-1]);return n.value}}}Ba.__name__=!0;var _A=t["tink.semver.Bound"]={__ename__:!0,__constructs__:null,Unbounded:{_hx_name:"Unbounded",_hx_index:0,__enum__:"tink.semver.Bound",toString:e},Exlusive:(r=function(k){return{_hx_index:1,limit:k,__enum__:"tink.semver.Bound",toString:e}},r._hx_name="Exlusive",r.__params__=["limit"],r),Inclusive:(r=function(k){return{_hx_index:2,limit:k,__enum__:"tink.semver.Bound",toString:e}},r._hx_name="Inclusive",r.__params__=["limit"],r)};_A.__constructs__=[_A.Unbounded,_A.Exlusive,_A.Inclusive];class J{static isLowerThan(n,a){switch(n._hx_index){case 1:let E=n.limit;switch(a._hx_index){case 1:let B=a.limit;return v.eq(E,B)?!1:!v.gt(E,B);case 2:return!v.gt(E,a.limit);default:return!0}break;case 2:let C=n.limit;switch(a._hx_index){case 1:let B=a.limit;return v.eq(C,B)?!1:!v.gt(C,B);case 2:return!v.gt(C,a.limit);default:return!0}break;default:return!0}}static min(n,a,E){switch(n._hx_index){case 0:return E==_.Lower?_A.Unbounded:a;case 1:let C=n.limit;switch(a._hx_index){case 0:return E==_.Lower?_A.Unbounded:n;case 1:return v.lt(C,a.limit)?n:a;case 2:let p=a.limit;return v.eq(C,p)?E==_.Lower?a:n:v.lt(C,p)?n:a}break;case 2:let B=n.limit;switch(a._hx_index){case 0:return E==_.Lower?_A.Unbounded:n;case 1:let p=a.limit;return v.eq(p,B)?E==_.Lower?n:a:v.lt(B,p)?n:a;case 2:return v.lt(B,a.limit)?n:a}break}}static max(n,a,E){switch(n._hx_index){case 0:return E==_.Upper?_A.Unbounded:a;case 1:let C=n.limit;switch(a._hx_index){case 0:return E==_.Upper?_A.Unbounded:n;case 1:return v.gt(C,a.limit)?n:a;case 2:let p=a.limit;return v.eq(C,p)?E==_.Upper?a:n:v.gt(C,p)?n:a}break;case 2:let B=n.limit;switch(a._hx_index){case 0:return E==_.Upper?_A.Unbounded:n;case 1:let p=a.limit;return v.eq(p,B)?E==_.Upper?n:a:v.gt(B,p)?n:a;case 2:return v.gt(B,a.limit)?n:a}break}}}J.__name__=!0;var _=t["tink.semver.ExtremumKind"]={__ename__:!0,__constructs__:null,Upper:{_hx_name:"Upper",_hx_index:0,__enum__:"tink.semver.ExtremumKind",toString:e},Lower:{_hx_name:"Lower",_hx_index:1,__enum__:"tink.semver.ExtremumKind",toString:e}};_.__constructs__=[_.Upper,_.Lower];class XA{static parse(n){return n==null||n==""?SA.Success(XA.WILDCARD):$A.catchExceptions((r=new lt(aA.ofString(n)),da(r,r.parseConstraint)),null,{fileName:"tink/semver/Constraint.hx",lineNumber:23,className:"tink.semver._Constraint.Constraint_Impl_",methodName:"parse"})}static create(n){let a=[],E=0;for(;E=")))return this.parseSimple(this.lower(_A.Inclusive));if(this.allowHere(aA.ofString(">")))return this.parseSimple(this.lower(_A.Exlusive));if(this.allowHere(aA.ofString("<=")))return this.parseSimple(this.upper(_A.Inclusive));if(this.allowHere(aA.ofString("<")))return this.parseSimple(this.upper(_A.Exlusive));if(this.allowHere(aA.ofString("=")))return XA.exact(this.parseInlineVersion());if(this.allowHere(aA.ofString("^")))return this.parseSimple(da(this,this.carret));{let n=this.parsePartial();if(this.allow(lt.HYPHEN)){let a=_A.Inclusive(this.full(n));return this.skipIgnored(),XA.fromRange({min:a,max:_A.Inclusive(this.parseInlineVersion())})}else if(n.patch<0){let a=this.full(n,!0);return v.range(a,n.minor<0?v.nextMajor(a):v.nextMinor(a))}else return XA.ofVersion(this.full(n))}}parseVersion(){let n=this.parseInlineVersion();return this.skipIgnored(),this.pos==this.max?n:this.die("Unexpected string",new o(this.pos,this.max))}parsePartial(){let n=this.pos,a=this,E=function(){return a.allowHere(aA.ofString("."))?a.num():-1},C=this.num(),B=E(),p=E(),m=null,R=-1;if(p>=0&&this.allowHere(lt.HYPHEN)){this.skipIgnored();let L=this.pos;for(;;){let mA;if(this.pos0?1:E<0?-1:0,C>0?1:C<0?-1:0),B>0?1:B<0?-1:0),p>0?1:p<0?-1:0),m>0?1:m<0?-1:0)}static idx(n,a){if(a==null)return 100;switch(a){case"alpha":return 1;case"beta":return 2;case"rc":return 3}}static eq(n,a){return v.compare(n,a)==0}static gt(n,a){return v.compare(n,a)==1}static lt(n,a){return v.compare(n,a)==-1}static gte(n,a){return v.compare(n,a)!=-1}static lte(n,a){return v.compare(n,a)!=1}static range(n,a){return XA.range(n,a)}static parse(n){return $A.catchExceptions((r=new lt(aA.ofString(n)),da(r,r.parseVersion)),v.reportError,{fileName:"tink/semver/Version.hx",lineNumber:97,className:"tink.semver._Version.Version_Impl_",methodName:"parse"})}static reportError(n){return typeof n=="string"?new $A(422,n,{fileName:"tink/semver/Version.hx",lineNumber:103,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"}):$A.withData(422,g.string(n),n,{fileName:"tink/semver/Version.hx",lineNumber:105,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"})}}class es{constructor(n,a,E,C,B){if(B==null&&(B=-1),n<0||a<0||E<0)throw I.thrown("version components must not be negative");this.major=n,this.minor=a,this.patch=E,this.preview=C,this.previewNum=B}toString(){let n=""+this.major+"."+this.minor+"."+this.patch;return this.preview!=null&&(n+="-"+this.preview,this.previewNum!=-1&&(n+="."+this.previewNum)),n}}es.__name__=!0;class An{static chain(n,a){return n==0?a:n}}class Dr{static get_value(n){let a=n.getValue();return ZA.cur!=null&&ZA.cur.subscribeTo(n,a),a}static map(n,a){return new ZA(fa.sync(function(){let E=Dr.get_value(n);return a(E)}),null,null)}}class ul{constructor(n,a){this.revision=Rr._new(),this.value=n}getRevision(){return this.revision}getValue(){return this.value}getComparator(){return null}onInvalidate(n){return null}}ul.__name__=!0;class _e{constructor(n){_e._hx_skip_constructor||this._hx_constructor(n)}_hx_constructor(n){this.list=new Ca,this.observers=new Map,this.revision=Rr._new()}getRevision(){return this.revision}onInvalidate(n){let a=this;if(this.observers.get(n))return null;{this.observers.set(n,!0);let E=this.list,C;if(E.disposeHandlers==null)C=null;else{let B=new ha(function(p){n.invalidate()},E);if(E.cells.push(B),E.used++==0){let p=E.onfill;hA.depth<500?(hA.depth++,p(),hA.depth--):hA.defer(p)}C=B}return new Qa(C,new El(function(){a.observers.delete(n)}))}}fire(){this.revision=Rr._new(),this.list.invoke(null)}}_e.__name__=!0;class Kd{static plain(n){return n}}class zd{static _new(n,a,E,C,B){return E==null?new Ia(n,a,C,B):new Bl(n,E,a,C,B)}}class Ia extends _e{constructor(n,a,E,C){if(_e._hx_skip_constructor){super();return}_e._hx_skip_constructor=!0,super(),_e._hx_skip_constructor=!1,this._hx_constructor(n,a,E,C)}_hx_constructor(n,a,E,C){if(super._hx_constructor(C),this.value=n,this.comparator=a,E!=null){let B=E,p=!1,m=function(){B(p)};this.list.ondrain=m;let R=E,L=!0,Z=function(){R(L)};this.list.onfill=Z}}getValue(){return this.value}getComparator(){return this.comparator}}Ia.__name__=!0;class Bl extends Ia{constructor(n,a,E,C,B){_e._hx_skip_constructor=!0,super(),_e._hx_skip_constructor=!1,this._hx_constructor(n,a,E,C,B)}_hx_constructor(n,a,E,C,B){this.guardApplied=!1,super._hx_constructor(n,E,C,B),this.guard=a}getValue(){return this.guardApplied?this.value:(this.guardApplied=!0,this.value=this.guard(this.value))}}Bl.__name__=!0;class fa{static sync(n){return function(a,E){return n()}}}class Il{constructor(n,a,E){this.used=!0,this.source=n,this.last=a,this.lastRev=n.getRevision(),this.owner=E,E.hot&&(this.link=this.source.onInvalidate(this.owner))}}Il.__name__=!0;class ZA extends _e{constructor(n,a,E){_e._hx_skip_constructor=!0,super(),_e._hx_skip_constructor=!1,this._hx_constructor(n,a,E)}_hx_constructor(n,a,E){this.sync=!0,this.dependencies=new Map,this.last=null,this.status=0,this.hot=!1,super._hx_constructor(E),this.compute=n,this.comparator=a;let C=this;this.list.onfill=function(){if(C.getValue(),C.getRevision(),C.subscriptions!=null){let B=0,p=C.subscriptions;for(;Bthis.revision)return this.revision=Rr._new();return this.revision}subsValid(){if(this.subscriptions==null)return!1;let n=0,a=this.subscriptions;for(;n>10)+55232)+String.fromCharCode((k&1023)+56320)}),String.__name__=!0,Array.__name__=!0,f.content=[{name:"releases.json",data:"Ww0KCXsidmVyc2lvbiI6ICIxLjEwLjE0In0sDQoJeyJ2ZXJzaW9uIjogIjEuMTAuMTMifSwNCgl7InZlcnNpb24iOiAiMS4xMC4xMiJ9LA0KCXsidmVyc2lvbiI6ICIxLjkuMTYifQ0KXQ0K"}],LA.__toStr={}.toString,Rr.counter=0,x.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",x.BYTES=N.ofString(x.CHARS),je.EMPTY=[],Tt.DBQT=String.fromCodePoint(34),OA.baseUrl=MA.fromString("https://dlcdn.apache.org/ant/binaries/"),OA.data=sr.fromArray(new zr().parse(f.getString("releases.json"))),hA.depth=0,ir._hx_skip_constructor=!1,vt._hx_skip_constructor=!1,Gt.NEVER_INST=new vt,Ql.BACKSLASH="\\",ye.byInt=new K,ye.WHITE=ye.oneOf([9,10,11,12,13,32]),ye.LOWER=ye.ofRange(new o(97,123)),ye.DIGIT=ye.ofRange(new o(48,58)),aA.CHARS=function(k){var n;let a=[];{let E=0;for(;E<128;){let C=E++;a.push(new As(String.fromCodePoint(C),0,1))}}return n=a,n}(this),aA.EMPTY=new As("",0,0),lt.OR=aA.ofString("||"),lt.DOT=aA.ofString("."),lt.HYPHEN=aA.ofString("-"),Dr.MAX_ITERATIONS=100,_e._hx_skip_constructor=!1,dt()})(global); +`+a+"}",B;case"string":return n;default:return String(n)}}}LA.__name__=!0;var xA=Zs(),rA=Pd(),kA=require("child_process"),zA=require("fs");function dt(){process.title="Setup Ant";let k=xA.getBooleanInput("optional-tasks"),n=xA.getInput("version"),a=XA.parse(n.length==0||n=="latest"?"*":n);switch(a._hx_index){case 0:let E=OA.find(a.data);switch(E._hx_index){case 0:let C=E.v;new Ke(C).install(k).handle(function(B){switch(B._hx_index){case 0:xA.info("Apache Ant "+C.version+" successfully "+(k?"installed with optional tasks":"installed")+' in "'+B.data+'".');break;case 1:xA.setFailed(B.failure.message);break}});break;case 1:xA.setFailed("No release matching the version constraint.");break}break;case 1:xA.setFailed("Invalid version constraint.");break}}class MA{static resolve(n,a){if(a.scheme!=null)return a;if(a.hosts[0]!=null){if(a.scheme!=null)return a;{let E=c.copy(a);return E.scheme=n.scheme,E}}else{let E={path:Et.join(n.path,a.path),payload:"",scheme:n.scheme,query:a.query,auth:n.auth,hosts:n.hosts,hash:a.hash};return MA.makePayload(E),E}}static makePayload(n){let a="",E=n.auth,C=n.hosts;E==null?C.length!=0&&(a="//"+C.join(",")):C.length==0?a="//"+(E==null?"null":E==null?"":""+E+"@"):a="//"+(E==null?"null":E==null?"":""+E+"@")+C.join(","),a+=n.path==null?"null":n.path;let B=n.query;B!=null&&(a+="?"+(B??"null"));let p=n.hash;p!=null&&(a+="#"+p),n.payload=a.toString()}static toString(n){return n.scheme==null?n.payload:""+n.scheme+":"+n.payload}static fromString(n){return MA.parse(n)}static noop(n){}static parse(n,a){for(;;){if(n==null){n="",a=null;continue}if(a==null&&(a=MA.noop),n=l.trim(n),n.startsWith("data:"))return{scheme:"data",payload:i.substr(n,5,null),hosts:[]};let E=new s("^(([a-zA-Z][a-zA-Z0-9\\-+.]*):)?((//(([^@/]+)@)?([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?)$",""),C=new s("^(\\[(.*)\\]|([^:]*))(:(.*))?$","");E.match(n);let B,p=E.matched(7);if(p==null)B=[];else{let R=[],L=0,Z=p.split(",");for(;L0&&m.charAt(0)!="/"&&(m="/"+m),{scheme:E.matched(2),payload:E.matched(3),hosts:B,auth:E.matched(6),path:Et.ofString(m),query:E.matched(10),hash:E.matched(12)}}}}class Kr{static _new(n,a){let E;if(a==null)E=n;else{if(a>65535||a<=0)throw I.thrown("Invalid port");E=""+n+":"+a}return E}}class Et{static join(n,a){if(a=="")return n;if(a.charAt(0)=="/")return a;if(n.charAt(n.length-1)=="/")return Et.ofString(n+a);{let E=n.lastIndexOf("/");return E==-1?a:Et.ofString(i.substr(n,0,E+1)+(a??"null"))}}static ofString(n){return Et.normalize(n)}static normalize(n){if(n=l.trim(l.replace(n,"\\","/")),n==".")return"./";let a=n.endsWith("/..")||n.endsWith("/")||n.endsWith("/."),E=[],C=n.startsWith("/"),B=0,p=0,m=n.split("/");for(;p0;){let C=E.next();if(a==null||a(C))return y.Some(C)}return y.None}static fromArray(n){let a=null,E=0,C=n.length;for(;C-- >0;)a=new je(++E,n[C],a==null?je.EMPTY:[a]);return a}}class je{constructor(n,a,E){this.value=a,this.length=n,this.tails=E??je.EMPTY}}je.__name__=!0;class Tt{constructor(){this.afterParsing=[],this.plugins=new JA(this)}init(n){for(this.pos=0,this.max=n.length,this.source=n;this.source.charCodeAt(this.pos)<33;)this.pos++}parseString(){for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let n;return this.source.charCodeAt(this.pos)==34?(this.pos+=1,n=!0):n=!1,n||this.die("Expected string"),this.parseRestOfString()}parseRestOfString(){return this.slice(this.skipString(),this.pos-1)}skipString(){let n=this.pos;for(;;){let a=this.source.indexOf(Tt.DBQT,this.pos);if(a==-1)this.die("unterminated string",n);else{this.pos=a+1;let E=this.pos-2;for(;this.source.charCodeAt(E)==92;)--E;if(!(E-this.pos&1))break}}return n}invalidNumber(n){return this.die("Invalid number "+this.source.substring(n,this.pos),n)}skipNumber(n){let a=this.pos-1,E=n==45,C=!E,B=n==48,p=!1,m=!1,R=!1,L=!1;for(;this.pos47?this.skipNumber(n):this.invalidChar(n)}}invalidChar(n){return this.die("invalid char "+l.hex(n,2),this.pos-1)}die(n,a,E){E==null&&(E=-1),a==null&&(a=-1),a==-1?(a=this.pos,E=a):E==-1&&(E=this.pos),E<=a&&(E=a+1);let C=function(p,m,R){return p.length>m?R?"... "+i.substr(p,p.length-m,null):i.substr(p,0,m)+" ...":p},B=a+E>>1;return $A.withData(422,n+(" at "+(E>a+1?"characters "+a+" - "+E:"character "+a)+" in "+(C(this.source.substring(0,a),20,!0)+" ----> "+C(this.source.substring(a,B),20,!1)+C(this.source.substring(B,E),20,!0)+" <---- "+C(this.source.substring(E,this.max),20,!1))),{source:this.source,start:a,end:E},{fileName:"tink/json/Parser.hx",lineNumber:472,className:"tink.json.BasicParser",methodName:"die"}).throwSelf()}}Tt.__name__=!0;class zr extends Tt{constructor(){super()}process0(){let n=this,a=0,E=null,C=this.pos;for(;;){let p=this.source.charCodeAt(this.pos++),m;if(p==123)break;m=p<33,m!=!0&&this.die("expected {")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let B;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;B=!0}else B=!1;if(!B){for(;;){for(;;){let R=this.source.charCodeAt(this.pos++),L;if(R==34)break;L=R<33,L!=!0&&this.die('expected "')}if(a=this.source.charCodeAt(this.pos++),a==118&&(a=this.source.charCodeAt(this.pos++),a==101&&(a=this.source.charCodeAt(this.pos++),a==114&&(a=this.source.charCodeAt(this.pos++),a==115&&(a=this.source.charCodeAt(this.pos++),a==105&&(a=this.source.charCodeAt(this.pos++),a==111&&(a=this.source.charCodeAt(this.pos++),a==110&&(a=this.source.charCodeAt(this.pos++),a==34)))))))){for(;;){let Z=this.source.charCodeAt(this.pos++),mA;if(Z==58)break;mA=Z<33,mA!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;R=!0}else R=!1;if(R)E=null;else{let Z=this.parseString();E=Z.indexOf(Ql.BACKSLASH)==-1?Z:JSON.parse('"'+Z+'"')}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,L=!0):L=!1,L)continue;break}for(a!=34&&this.skipString();;){let R=this.source.charCodeAt(this.pos++),L;if(R==58)break;L=R<33,L!=!0&&this.die("expected :")}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;for(this.skipValue();this.source.charCodeAt(this.pos)<33;)this.pos++;let m;if(this.source.charCodeAt(this.pos)==44?(this.pos+=1,m=!0):m=!1,!m)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let p;if(this.source.charCodeAt(this.pos)==125){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;p=!0}else p=!1;p||this.die("Expected }")}return{version:E}}parse(n){for(this.afterParsing.length>0&&(this.afterParsing=[]),this.init(n);this.source.charCodeAt(this.pos)<33;)this.pos++;let a;if(this.source.charCodeAt(this.pos)==91){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;a=!0}else a=!1;a||this.die("Expected [");let E=[];for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let C;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;C=!0}else C=!1;if(!C){for(;;){for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let R;if(this.source.charCodeAt(this.pos)==110&&this.source.charCodeAt(this.pos+1)==117&&this.source.charCodeAt(this.pos+2)==108&&this.source.charCodeAt(this.pos+3)==108){for(this.pos+=4;this.source.charCodeAt(this.pos)<33;)this.pos++;R=!0}else R=!1;for(E.push(new OA(R?null:this.process0()));this.source.charCodeAt(this.pos)<33;)this.pos++;let L;if(this.source.charCodeAt(this.pos)==44){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;L=!0}else L=!1;if(!L)break}for(;this.source.charCodeAt(this.pos)<33;)this.pos++;let m;if(this.source.charCodeAt(this.pos)==93){for(this.pos+=1;this.source.charCodeAt(this.pos)<33;)this.pos++;m=!0}else m=!1;m||this.die("Expected ]")}let B=0,p=this.afterParsing;for(;B0&&(this.afterParsing=[]),E}}zr.__name__=!0;class JA{constructor(n){this.target=n,this.registry=new qA}}JA.__name__=!0;class OA{constructor(n){n==null&&(n={});let a=this,E=ZA.cur;ZA.cur=null;let C=new ZA(fa.sync(function(){return MA.resolve(OA.baseUrl,MA.fromString("apache-ant-"+a.version+"-bin.zip"))}),null,null);ZA.cur=E,this.__coco_url=C;let B=ZA.cur;ZA.cur=null;let p=new ZA(fa.sync(function(){let R=!1,L=new Ba(OA.data);for(;L.list.length>0;)if(L.next().version==a.version){R=!0;break}return R}),null,null);ZA.cur=B,this.__coco_exists=p;let m=n.version;this.version=m??"0.0.0",this.__coco_transitionCount=zd._new(0),this.errorTrigger=Zd.trigger(),this.transitionErrors=this.errorTrigger,this.annex=new h(this),this.observables={exists:this.__coco_exists,url:this.__coco_url,version:new ul(this.version,null),isInTransition:Dr.map(this.__coco_transitionCount,Kd.plain(function(R){return R>0}))}}static find(n){return sr.first(OA.data,function(a){return XA.matches(n,$i.sure(v.parse(a.version)))})}}OA.__name__=!0;class Ke{constructor(n){this.release=n}download(n){n==null&&(n=!1);let a=this;return $r.next($r.next($r.next(Gt.ofJsPromise(rA.downloadTool(MA.toString(Dr.get_value(this.release.__coco_url)))),function(E){return Gt.ofJsPromise(rA.extractZip(E))}),function(E){return $i.next(a.findSubfolder(E),function(C){return new Jt(new pt(SA.Success(a.normalizeSeparator(yA.join([E,C])))))})}),function(E){return n?$r.next(a.fetchOptionalTasks(E),function(C){return new Jt(new pt(SA.Success(E)))}):new Jt(new pt(SA.Success(E)))})}install(n){n==null&&(n=!1);let a=rA.find("ant",this.release.version),E=this,C=a.length>0?new Jt(new pt(SA.Success(a))):$r.next(this.download(n),function(B){return Gt.ofJsPromise(rA.cacheDir(B,"ant",E.release.version))});return $r.next(C,function(B){let p=E.normalizeSeparator(B);return xA.addPath(E.normalizeSeparator(yA.join([B,"bin"]))),xA.exportVariable("ANT_HOME",p),new Jt(new pt(SA.Success(p)))})}fetchOptionalTasks(n){let a=yA.addTrailingSlash(process.cwd());return n==null?c.deleteField(process.env,"ANT_HOME"):process.env.ANT_HOME=n,process.chdir(n),kA.spawnSync("ant -buildfile fetch.xml -noinput -silent -Ddest=system",{shell:!0,stdio:"inherit"}),process.chdir(a),new Jt(new pt(SA.Success(null)))}findSubfolder(n){let a=zA.readdirSync(n),E=[],C=0;for(;C>1&&n.compact()}}}ha.__name__=!0;class ir{constructor(n){ir._hx_skip_constructor||this._hx_constructor(n)}_hx_constructor(n){this.disposeHandlers=[],this.f=n}dispose(){let n=this.disposeHandlers;if(n!=null){this.disposeHandlers=null;let a=this.f;this.f=ir.noop,a();let E=0;for(;E0){this.used=0;let E=this.ondrain;hA.depth<500?(hA.depth++,E(),hA.depth--):hA.defer(E)}}invoke(n){let a=this;if(hA.depth<500){if(hA.depth++,a.disposeHandlers!=null)if(a.busy){if(a.destructive!=!0){let E=a,C=n,B=function(){E.invoke(C)};a.queue.push(B)}}else{a.busy=!0,a.destructive&&a.dispose();let E=a.cells.length,C=0;for(;C0&&a.queue.shift()())}hA.depth--}else hA.defer(function(){if(a.disposeHandlers!=null)if(a.busy){if(a.destructive!=!0){let E=a,C=n,B=function(){E.invoke(C)};a.queue.push(B)}}else{a.busy=!0,a.destructive&&a.dispose();let E=a.cells.length,C=0;for(;C0&&a.queue.shift()())}})}compact(){if(!this.busy)if(this.used==0){this.resize(0);let n=this.ondrain;hA.depth<500?(hA.depth++,n(),hA.depth--):hA.defer(n)}else{let n=0,a=0,E=this.cells.length;for(;a256&&(n=new o(n.min,256));let E=n;for(;E.minn.length?0:a+n.length:a>n.length?n.length:a}static wrap(n,a){return a<0?a+n.length:a}static ofString(n){if(n==null||n=="")return aA.EMPTY;if(n.length==1){let a=n.charCodeAt(0);return an.length)return!1;let C=a;return aA.isEqual(n.string,n.start+E,a.length,C.string,C.start,C.length)}static isEqual(n,a,E,C,B,p){if(p!=E)return!1;let m=0;for(;m0}next(){let n=this.list.pop();if(n==null)return null;{let a=-n.tails.length;for(;a<0;)this.list.push(n.tails[-a++-1]);return n.value}}}Ba.__name__=!0;var _A=t["tink.semver.Bound"]={__ename__:!0,__constructs__:null,Unbounded:{_hx_name:"Unbounded",_hx_index:0,__enum__:"tink.semver.Bound",toString:e},Exlusive:(r=function(k){return{_hx_index:1,limit:k,__enum__:"tink.semver.Bound",toString:e}},r._hx_name="Exlusive",r.__params__=["limit"],r),Inclusive:(r=function(k){return{_hx_index:2,limit:k,__enum__:"tink.semver.Bound",toString:e}},r._hx_name="Inclusive",r.__params__=["limit"],r)};_A.__constructs__=[_A.Unbounded,_A.Exlusive,_A.Inclusive];class J{static isLowerThan(n,a){switch(n._hx_index){case 1:let E=n.limit;switch(a._hx_index){case 1:let B=a.limit;return v.eq(E,B)?!1:!v.gt(E,B);case 2:return!v.gt(E,a.limit);default:return!0}break;case 2:let C=n.limit;switch(a._hx_index){case 1:let B=a.limit;return v.eq(C,B)?!1:!v.gt(C,B);case 2:return!v.gt(C,a.limit);default:return!0}break;default:return!0}}static min(n,a,E){switch(n._hx_index){case 0:return E==_.Lower?_A.Unbounded:a;case 1:let C=n.limit;switch(a._hx_index){case 0:return E==_.Lower?_A.Unbounded:n;case 1:return v.lt(C,a.limit)?n:a;case 2:let p=a.limit;return v.eq(C,p)?E==_.Lower?a:n:v.lt(C,p)?n:a}break;case 2:let B=n.limit;switch(a._hx_index){case 0:return E==_.Lower?_A.Unbounded:n;case 1:let p=a.limit;return v.eq(p,B)?E==_.Lower?n:a:v.lt(B,p)?n:a;case 2:return v.lt(B,a.limit)?n:a}break}}static max(n,a,E){switch(n._hx_index){case 0:return E==_.Upper?_A.Unbounded:a;case 1:let C=n.limit;switch(a._hx_index){case 0:return E==_.Upper?_A.Unbounded:n;case 1:return v.gt(C,a.limit)?n:a;case 2:let p=a.limit;return v.eq(C,p)?E==_.Upper?a:n:v.gt(C,p)?n:a}break;case 2:let B=n.limit;switch(a._hx_index){case 0:return E==_.Upper?_A.Unbounded:n;case 1:let p=a.limit;return v.eq(p,B)?E==_.Upper?n:a:v.gt(B,p)?n:a;case 2:return v.gt(B,a.limit)?n:a}break}}}J.__name__=!0;var _=t["tink.semver.ExtremumKind"]={__ename__:!0,__constructs__:null,Upper:{_hx_name:"Upper",_hx_index:0,__enum__:"tink.semver.ExtremumKind",toString:e},Lower:{_hx_name:"Lower",_hx_index:1,__enum__:"tink.semver.ExtremumKind",toString:e}};_.__constructs__=[_.Upper,_.Lower];class XA{static parse(n){return n==null||n==""?SA.Success(XA.WILDCARD):$A.catchExceptions((r=new lt(aA.ofString(n)),da(r,r.parseConstraint)),null,{fileName:"tink/semver/Constraint.hx",lineNumber:23,className:"tink.semver._Constraint.Constraint_Impl_",methodName:"parse"})}static create(n){let a=[],E=0;for(;E=")))return this.parseSimple(this.lower(_A.Inclusive));if(this.allowHere(aA.ofString(">")))return this.parseSimple(this.lower(_A.Exlusive));if(this.allowHere(aA.ofString("<=")))return this.parseSimple(this.upper(_A.Inclusive));if(this.allowHere(aA.ofString("<")))return this.parseSimple(this.upper(_A.Exlusive));if(this.allowHere(aA.ofString("=")))return XA.exact(this.parseInlineVersion());if(this.allowHere(aA.ofString("^")))return this.parseSimple(da(this,this.carret));{let n=this.parsePartial();if(this.allow(lt.HYPHEN)){let a=_A.Inclusive(this.full(n));return this.skipIgnored(),XA.fromRange({min:a,max:_A.Inclusive(this.parseInlineVersion())})}else if(n.patch<0){let a=this.full(n,!0);return v.range(a,n.minor<0?v.nextMajor(a):v.nextMinor(a))}else return XA.ofVersion(this.full(n))}}parseVersion(){let n=this.parseInlineVersion();return this.skipIgnored(),this.pos==this.max?n:this.die("Unexpected string",new o(this.pos,this.max))}parsePartial(){let n=this.pos,a=this,E=function(){return a.allowHere(aA.ofString("."))?a.num():-1},C=this.num(),B=E(),p=E(),m=null,R=-1;if(p>=0&&this.allowHere(lt.HYPHEN)){this.skipIgnored();let L=this.pos;for(;;){let mA;if(this.pos0?1:E<0?-1:0,C>0?1:C<0?-1:0),B>0?1:B<0?-1:0),p>0?1:p<0?-1:0),m>0?1:m<0?-1:0)}static idx(n,a){if(a==null)return 100;switch(a){case"alpha":return 1;case"beta":return 2;case"rc":return 3}}static eq(n,a){return v.compare(n,a)==0}static gt(n,a){return v.compare(n,a)==1}static lt(n,a){return v.compare(n,a)==-1}static gte(n,a){return v.compare(n,a)!=-1}static lte(n,a){return v.compare(n,a)!=1}static range(n,a){return XA.range(n,a)}static parse(n){return $A.catchExceptions((r=new lt(aA.ofString(n)),da(r,r.parseVersion)),v.reportError,{fileName:"tink/semver/Version.hx",lineNumber:97,className:"tink.semver._Version.Version_Impl_",methodName:"parse"})}static reportError(n){return typeof n=="string"?new $A(422,n,{fileName:"tink/semver/Version.hx",lineNumber:103,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"}):$A.withData(422,g.string(n),n,{fileName:"tink/semver/Version.hx",lineNumber:105,className:"tink.semver._Version.Version_Impl_",methodName:"reportError"})}}class es{constructor(n,a,E,C,B){if(B==null&&(B=-1),n<0||a<0||E<0)throw I.thrown("version components must not be negative");this.major=n,this.minor=a,this.patch=E,this.preview=C,this.previewNum=B}toString(){let n=""+this.major+"."+this.minor+"."+this.patch;return this.preview!=null&&(n+="-"+this.preview,this.previewNum!=-1&&(n+="."+this.previewNum)),n}}es.__name__=!0;class An{static chain(n,a){return n==0?a:n}}class Dr{static get_value(n){let a=n.getValue();return ZA.cur!=null&&ZA.cur.subscribeTo(n,a),a}static map(n,a){return new ZA(fa.sync(function(){let E=Dr.get_value(n);return a(E)}),null,null)}}class ul{constructor(n,a){this.revision=Rr._new(),this.value=n}getRevision(){return this.revision}getValue(){return this.value}getComparator(){return null}onInvalidate(n){return null}}ul.__name__=!0;class _e{constructor(n){_e._hx_skip_constructor||this._hx_constructor(n)}_hx_constructor(n){this.list=new Ca,this.observers=new Map,this.revision=Rr._new()}getRevision(){return this.revision}onInvalidate(n){let a=this;if(this.observers.get(n))return null;{this.observers.set(n,!0);let E=this.list,C;if(E.disposeHandlers==null)C=null;else{let B=new ha(function(p){n.invalidate()},E);if(E.cells.push(B),E.used++==0){let p=E.onfill;hA.depth<500?(hA.depth++,p(),hA.depth--):hA.defer(p)}C=B}return new Qa(C,new El(function(){a.observers.delete(n)}))}}fire(){this.revision=Rr._new(),this.list.invoke(null)}}_e.__name__=!0;class Kd{static plain(n){return n}}class zd{static _new(n,a,E,C,B){return E==null?new Ia(n,a,C,B):new Bl(n,E,a,C,B)}}class Ia extends _e{constructor(n,a,E,C){if(_e._hx_skip_constructor){super();return}_e._hx_skip_constructor=!0,super(),_e._hx_skip_constructor=!1,this._hx_constructor(n,a,E,C)}_hx_constructor(n,a,E,C){if(super._hx_constructor(C),this.value=n,this.comparator=a,E!=null){let B=E,p=!1,m=function(){B(p)};this.list.ondrain=m;let R=E,L=!0,Z=function(){R(L)};this.list.onfill=Z}}getValue(){return this.value}getComparator(){return this.comparator}}Ia.__name__=!0;class Bl extends Ia{constructor(n,a,E,C,B){_e._hx_skip_constructor=!0,super(),_e._hx_skip_constructor=!1,this._hx_constructor(n,a,E,C,B)}_hx_constructor(n,a,E,C,B){this.guardApplied=!1,super._hx_constructor(n,E,C,B),this.guard=a}getValue(){return this.guardApplied?this.value:(this.guardApplied=!0,this.value=this.guard(this.value))}}Bl.__name__=!0;class fa{static sync(n){return function(a,E){return n()}}}class Il{constructor(n,a,E){this.used=!0,this.source=n,this.last=a,this.lastRev=n.getRevision(),this.owner=E,E.hot&&(this.link=this.source.onInvalidate(this.owner))}}Il.__name__=!0;class ZA extends _e{constructor(n,a,E){_e._hx_skip_constructor=!0,super(),_e._hx_skip_constructor=!1,this._hx_constructor(n,a,E)}_hx_constructor(n,a,E){this.sync=!0,this.dependencies=new Map,this.last=null,this.status=0,this.hot=!1,super._hx_constructor(E),this.compute=n,this.comparator=a;let C=this;this.list.onfill=function(){if(C.getValue(),C.getRevision(),C.subscriptions!=null){let B=0,p=C.subscriptions;for(;Bthis.revision)return this.revision=Rr._new();return this.revision}subsValid(){if(this.subscriptions==null)return!1;let n=0,a=this.subscriptions;for(;n>10)+55232)+String.fromCharCode((k&1023)+56320)}),String.__name__=!0,Array.__name__=!0,f.content=[{name:"releases.json",data:"Ww0KCXsidmVyc2lvbiI6ICIxLjEwLjE0In0sDQoJeyJ2ZXJzaW9uIjogIjEuMTAuMTMifSwNCgl7InZlcnNpb24iOiAiMS4xMC4xMiJ9LA0KCXsidmVyc2lvbiI6ICIxLjkuMTYifQ0KXQ0K"}],LA.__toStr={}.toString,Rr.counter=0,x.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",x.BYTES=N.ofString(x.CHARS),je.EMPTY=[],Tt.DBQT=String.fromCodePoint(34),OA.baseUrl=MA.fromString("https://dlcdn.apache.org/ant/binaries/"),OA.data=sr.fromArray(new zr().parse(f.getString("releases.json"))),hA.depth=0,ir._hx_skip_constructor=!1,vt._hx_skip_constructor=!1,Gt.NEVER_INST=new vt,Ql.BACKSLASH="\\",ye.byInt=new K,ye.WHITE=ye.oneOf([9,10,11,12,13,32]),ye.LOWER=ye.ofRange(new o(97,123)),ye.DIGIT=ye.ofRange(new o(48,58)),aA.CHARS=function(k){var n;let a=[];{let E=0;for(;E<128;){let C=E++;a.push(new As(String.fromCodePoint(C),0,1))}}return n=a,n}(this),aA.EMPTY=new As("",0,0),lt.OR=aA.ofString("||"),lt.DOT=aA.ofString("."),lt.HYPHEN=aA.ofString("-"),Dr.MAX_ITERATIONS=100,_e._hx_skip_constructor=!1,dt()})(global); diff --git a/src/setup_ant/Program.hx b/src/setup_ant/Program.hx index df4b4a1..7657a0f 100644 --- a/src/setup_ant/Program.hx +++ b/src/setup_ant/Program.hx @@ -1,10 +1,13 @@ package setup_ant; import js.actions.Core; +import js.Node.process; import tink.semver.Constraint; /** Application entry point. **/ function main() { + process.title = "Setup Ant"; + final optionalTasks = Core.getBooleanInput("optional-tasks"); final version = Core.getInput("version");