浏览代码

add test script

Armin Schrenk 1 年之前
父节点
当前提交
93b4cbfb2c
共有 1 个文件被更改,包括 23 次插入0 次删除
  1. 23 0
      dist/win/signJarDlls.ps1

+ 23 - 0
dist/win/signJarDlls.ps1

@@ -0,0 +1,23 @@
+<#
+1. Select jar file
+2. extract jar to own directory
+3. Sign everything
+4. Update dlls in the jar
+#>
+
+New-Item -Path ".\extract" -ItemType Directory
+Get-ChildItem -Path "." -File *.jar | ForEach-Object {
+    $jar = Copy-Item $_ -Destination ".\extract" -PassThru
+    Set-Location -Path ".\extract"
+    "Extracting jar $($jar.FullName)"
+    jar --file=$($_.FullName) --extract
+    Get-ChildItem -Path "." -Recurse -File "*.dll" | ForEach-Object {
+        <# pipe into signtool, here we are just writing something into the file #>
+        Set-Content -Path $_ -Value "Hello"
+        jar --file=$($jar.FullName) --update $(Resolve-Path -Relative -Path $_)
+    }
+    Move-Item -Path $($jar.FullName) -Destination $_ -Force
+    Remove-Item -Path ".\*" -Force -Recurse
+    Set-Location -Path ".."
+}
+Remove-Item -Path ".\extract"