Skip to content

Commit f606d68

Browse files
dkocherAliveDevil
authored andcommitted
Merge pull request #17145 from iterate-ch/feature/GH-17143
Update dependency and load native libraries without unpacking from archive
2 parents 390fe46 + 9f69bf6 commit f606d68

File tree

10 files changed

+64
-8
lines changed

10 files changed

+64
-8
lines changed

cli/dll/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,21 @@
130130
</exclusion>
131131
</exclusions>
132132
</dependency>
133+
<dependency>
134+
<groupId>org.fusesource.jansi</groupId>
135+
<artifactId>jansi</artifactId>
136+
<version>${jansi.version}</version>
137+
<classifier>x86_64</classifier>
138+
<type>dll</type>
139+
<scope>runtime</scope>
140+
</dependency>
141+
<dependency>
142+
<groupId>org.fusesource.jansi</groupId>
143+
<artifactId>jansi</artifactId>
144+
<version>${jansi.version}</version>
145+
<classifier>arm64</classifier>
146+
<type>dll</type>
147+
<scope>runtime</scope>
148+
</dependency>
133149
</dependencies>
134150
</project>

cli/linux/pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@
8181
<version>${jna-version}</version>
8282
<scope>runtime</scope>
8383
</dependency>
84+
<dependency>
85+
<groupId>org.fusesource.jansi</groupId>
86+
<artifactId>jansi</artifactId>
87+
<version>${jansi.version}</version>
88+
<classifier>arm64</classifier>
89+
<type>so</type>
90+
<scope>runtime</scope>
91+
</dependency>
8492
</dependencies>
8593
</profile>
8694
<profile>
@@ -99,6 +107,14 @@
99107
<version>${jna-version}</version>
100108
<scope>runtime</scope>
101109
</dependency>
110+
<dependency>
111+
<groupId>org.fusesource.jansi</groupId>
112+
<artifactId>jansi</artifactId>
113+
<version>${jansi.version}</version>
114+
<classifier>${os.arch}</classifier>
115+
<type>so</type>
116+
<scope>runtime</scope>
117+
</dependency>
102118
</dependencies>
103119
</profile>
104120
<profile>
@@ -117,6 +133,14 @@
117133
<version>${jna-version}</version>
118134
<scope>runtime</scope>
119135
</dependency>
136+
<dependency>
137+
<groupId>org.fusesource.jansi</groupId>
138+
<artifactId>jansi</artifactId>
139+
<version>${jansi.version}</version>
140+
<classifier>x86_64</classifier>
141+
<type>so</type>
142+
<scope>runtime</scope>
143+
</dependency>
120144
</dependencies>
121145
</profile>
122146
</profiles>

cli/osx/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<property name="app.runtime.archs" value="'x86_64 arm64'"/>
2424
<property name="app.runtime.system.min" value="10.13"/>
2525
<property name="jvm.runtime.args"
26-
value="-client --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED -Djava.library.path=$APP_PACKAGE/Contents/Frameworks -Djna.boot.library.path=$APP_PACKAGE/Contents/Frameworks -Djna.library.path=$APP_PACKAGE/Contents/Frameworks -Djna.nounpack=true -Djava.awt.headless=true -Dsun.jnu.encoding=utf-8 -Dfile.encoding=utf-8 -Dsun.io.useCanonCaches=false -DLog4jContextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector -XX:+UseG1GC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:+UseStringDeduplication"/>
26+
value="-client --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED -Djava.library.path=$APP_PACKAGE/Contents/Frameworks -Dlibrary.jansi.path=$APP_PACKAGE/Contents/Frameworks -Djna.boot.library.path=$APP_PACKAGE/Contents/Frameworks -Djna.library.path=$APP_PACKAGE/Contents/Frameworks -Djna.nounpack=true -Djava.awt.headless=true -Dsun.jnu.encoding=utf-8 -Dfile.encoding=utf-8 -Dsun.io.useCanonCaches=false -DLog4jContextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector -XX:+UseG1GC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:+UseStringDeduplication"/>
2727

2828
<condition property="jvm.runtime.debug"
2929
value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 ">

cli/osx/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
</goals>
8282
<configuration>
8383
<outputDirectory>${project.build.directory}/duck.bundle/Contents/Frameworks</outputDirectory>
84-
<includeTypes>dylib</includeTypes>
84+
<includeTypes>dylib,jnilib</includeTypes>
8585
<includeScope>runtime</includeScope>
8686
<stripClassifier>true</stripClassifier>
8787
<stripVersion>true</stripVersion>
@@ -226,5 +226,12 @@
226226
<scope>test</scope>
227227
<version>${project.version}</version>
228228
</dependency>
229+
<dependency>
230+
<groupId>org.fusesource.jansi</groupId>
231+
<artifactId>libjansi</artifactId>
232+
<version>${jansi.version}</version>
233+
<type>jnilib</type>
234+
<scope>runtime</scope>
235+
</dependency>
229236
</dependencies>
230237
</project>

cli/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
</dependency>
8080
<dependency>
8181
<groupId>org.fusesource.jansi</groupId>
82-
<artifactId>jansi</artifactId>
83-
<version>2.4.0</version>
82+
<artifactId>jansi-min</artifactId>
83+
<version>${jansi.version}</version>
8484
</dependency>
8585
</dependencies>
8686
</project>

cli/src/main/csharp/ch/cyberduck/cli/WindowsTerminalPreferences.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
//
1818

19+
using System;
1920
using ch.cyberduck.cli;
2021
using ch.cyberduck.core.cryptomator;
2122
using ch.cyberduck.core.serviceloader;
@@ -28,6 +29,7 @@
2829
using Ch.Cyberduck.Core.Proxy;
2930
using java.security;
3031
using sun.security.mscapi;
32+
using JavaSystem = java.lang.System;
3133

3234
namespace Ch.Cyberduck.Cli
3335
{
@@ -48,6 +50,8 @@ protected override void setDefaults()
4850
{
4951
base.setDefaults();
5052

53+
JavaSystem.setProperty("library.jansi.path", AppContext.BaseDirectory);
54+
5155
this.setDefault("application.language", "en");
5256

5357
Security.addProvider(new SunMSCAPI());

cli/src/main/csharp/duck.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<ItemGroup>
1616
<Content Include="$(CyberduckDir)Acknowledgments.rtf" CopyToOutputDirectory="PreserveNewest" />
1717
<Content Include="$(CyberduckDir)i18n/src/main/resources/en.lproj/License.txt" CopyToOutputDirectory="PreserveNewest" />
18+
<Content Include="$(TargetBuildDir)lib\$(Platform)\jansi.dll" CopyToOutputDirectory="PreserveNewest" />
1819
<Content Include="$(TargetBuildDir)lib\$(Platform)\jnidispatch.dll" CopyToOutputDirectory="PreserveNewest" />
1920

2021
<Content Include="$(CyberduckDir)bookmarks/*.duck">

cli/src/main/java/ch/cyberduck/cli/LinuxTerminalPreferences.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ public LinuxTerminalPreferences() {
4545
protected void setDefaults() {
4646
super.setDefaults();
4747

48+
this.setProperty("library.jansi.path", new ClasspathResourcesFinder().find().getAbsolute());
49+
this.setProperty("jna.boot.library.path", new ClasspathResourcesFinder().find().getAbsolute());
50+
4851
try {
4952
final Process echo = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", "echo ~"});
5053
this.setDefault("local.user.home", StringUtils.strip(IOUtils.toString(echo.getInputStream(), Charset.defaultCharset())));

core/src/main/csharp/ch/cyberduck/core/preferences/ApplicationPreferences.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ public ApplicationPreferences(Locales locales, IPropertyStoreFactory propertySto
4545
this.locales = locales;
4646
SetEnvironmentInfo();
4747
this.propertyStore = propertyStore.New();
48-
49-
JavaSystem.setProperty("jna.boot.library.path", AppContext.BaseDirectory);
5048
}
5149

5250
public override List applicationLocales() => locales.applicationLocales();
@@ -145,6 +143,8 @@ protected override void setDefaults()
145143
{
146144
base.setDefaults();
147145

146+
JavaSystem.setProperty("jna.boot.library.path", AppContext.BaseDirectory);
147+
148148
this.setDefault("os.version", Environment.OSVersion.Version.ToString());
149149

150150
this.setDefault("oauth.handler.scheme",

pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
<jwt.version>4.5.0</jwt.version>
9494
<java-native-dll>8u312b07</java-native-dll>
9595
<rococoa-version>0.10.0</rococoa-version>
96+
<jansi.version>2.4.2</jansi.version>
9697
<surefire.group.excluded>ch.cyberduck.test.IntegrationTest</surefire.group.excluded>
9798
</properties>
9899

@@ -624,7 +625,7 @@
624625
</goals>
625626
<configuration>
626627
<outputDirectory>${project.build.directory}/lib</outputDirectory>
627-
<excludeClassifiers>net472,net8.0,net8.0-x64,net8.0-arm64,aarch64,x86_64</excludeClassifiers>
628+
<excludeClassifiers>net472,net8.0,net8.0-x64,net8.0-arm64,aarch64,arm64,x86_64</excludeClassifiers>
628629
<includeTypes>dll</includeTypes>
629630
<stripClassifier>true</stripClassifier>
630631
<stripVersion>true</stripVersion>
@@ -652,7 +653,7 @@
652653
</goals>
653654
<configuration>
654655
<outputDirectory>${project.build.directory}/lib/arm64</outputDirectory>
655-
<includeClassifiers>aarch64</includeClassifiers>
656+
<includeClassifiers>aarch64,arm64</includeClassifiers>
656657
<includeTypes>dll</includeTypes>
657658
<stripClassifier>true</stripClassifier>
658659
<stripVersion>true</stripVersion>

0 commit comments

Comments
 (0)