|
|
@@ -96,32 +96,33 @@ try {
|
|
|
Pop-Location
|
|
|
if ($JarExtract -ne 0) { throw "解压 Paho jar 失败" }
|
|
|
|
|
|
- $ModuleInfo = @"
|
|
|
-module org.eclipse.paho.client.mqttv3 {
|
|
|
- requires transitive java.logging;
|
|
|
- requires transitive java.prefs;
|
|
|
-
|
|
|
- exports org.eclipse.paho.client.mqttv3;
|
|
|
- exports org.eclipse.paho.client.mqttv3.internal;
|
|
|
- exports org.eclipse.paho.client.mqttv3.internal.security;
|
|
|
- exports org.eclipse.paho.client.mqttv3.internal.websocket;
|
|
|
- exports org.eclipse.paho.client.mqttv3.internal.wire;
|
|
|
- exports org.eclipse.paho.client.mqttv3.logging;
|
|
|
- exports org.eclipse.paho.client.mqttv3.persist;
|
|
|
- exports org.eclipse.paho.client.mqttv3.spi;
|
|
|
- exports org.eclipse.paho.client.mqttv3.util;
|
|
|
-
|
|
|
- uses org.eclipse.paho.client.mqttv3.spi.NetworkModuleFactory;
|
|
|
-
|
|
|
- provides org.eclipse.paho.client.mqttv3.spi.NetworkModuleFactory with
|
|
|
- org.eclipse.paho.client.mqttv3.internal.TCPNetworkModuleFactory,
|
|
|
- org.eclipse.paho.client.mqttv3.internal.SSLNetworkModuleFactory,
|
|
|
- org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketNetworkModuleFactory,
|
|
|
- org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketSecureNetworkModuleFactory;
|
|
|
-}
|
|
|
-"@
|
|
|
+ # 逐行数组写入,避免 here-string 在 Windows PowerShell 5.1 下对换行符 / 编码敏感
|
|
|
+ $ModuleInfoLines = @(
|
|
|
+ 'module org.eclipse.paho.client.mqttv3 {',
|
|
|
+ ' requires transitive java.logging;',
|
|
|
+ ' requires transitive java.prefs;',
|
|
|
+ '',
|
|
|
+ ' exports org.eclipse.paho.client.mqttv3;',
|
|
|
+ ' exports org.eclipse.paho.client.mqttv3.internal;',
|
|
|
+ ' exports org.eclipse.paho.client.mqttv3.internal.security;',
|
|
|
+ ' exports org.eclipse.paho.client.mqttv3.internal.websocket;',
|
|
|
+ ' exports org.eclipse.paho.client.mqttv3.internal.wire;',
|
|
|
+ ' exports org.eclipse.paho.client.mqttv3.logging;',
|
|
|
+ ' exports org.eclipse.paho.client.mqttv3.persist;',
|
|
|
+ ' exports org.eclipse.paho.client.mqttv3.spi;',
|
|
|
+ ' exports org.eclipse.paho.client.mqttv3.util;',
|
|
|
+ '',
|
|
|
+ ' uses org.eclipse.paho.client.mqttv3.spi.NetworkModuleFactory;',
|
|
|
+ '',
|
|
|
+ ' provides org.eclipse.paho.client.mqttv3.spi.NetworkModuleFactory with',
|
|
|
+ ' org.eclipse.paho.client.mqttv3.internal.TCPNetworkModuleFactory,',
|
|
|
+ ' org.eclipse.paho.client.mqttv3.internal.SSLNetworkModuleFactory,',
|
|
|
+ ' org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketNetworkModuleFactory,',
|
|
|
+ ' org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketSecureNetworkModuleFactory;',
|
|
|
+ '}'
|
|
|
+ )
|
|
|
$ModuleInfoFile = Join-Path $PatchTmp "module-info.java"
|
|
|
- Set-Content -Path $ModuleInfoFile -Value $ModuleInfo -Encoding ASCII
|
|
|
+ Set-Content -Path $ModuleInfoFile -Value $ModuleInfoLines -Encoding ASCII
|
|
|
|
|
|
& javac --patch-module "org.eclipse.paho.client.mqttv3=$ExpDir" -d $PatchTmp $ModuleInfoFile
|
|
|
if ($LASTEXITCODE -ne 0) { throw "javac 生成 module-info.class 失败" }
|