File tree Expand file tree Collapse file tree 2 files changed +16
-21
lines changed
src/main/java/io/github/fvarrui/javapackager Expand file tree Collapse file tree 2 files changed +16
-21
lines changed Original file line number Diff line number Diff line change 11package io .github .fvarrui .javapackager .model ;
22
33import org .apache .commons .lang3 .SystemUtils ;
4+ import org .redline_rpm .header .Architecture ;
45
56public enum Arch {
6- aarch64 ("arm64" , "AARCH64" ),
7- x64 ("amd64" , "X86_64" ),
8- x86 ("i386" , "i386" );
9-
10- private String deb ;
11- private String rpm ;
12-
13- Arch (String deb , String rpm ) {
14- this .deb = deb ;
15- this .rpm = rpm ;
16- }
17-
18- public String getDeb () {
19- return deb ;
20- }
21-
22- public String getRpm () {
23- return rpm ;
24- }
7+ aarch64 ,
8+ x64 ,
9+ x86 ;
2510
2611 public static Arch getDefault () {
2712 switch (SystemUtils .OS_ARCH ) {
@@ -41,4 +26,13 @@ public static Arch getDefault() {
4126 }
4227 }
4328
44- }
29+ public Architecture toRpmArchitecture () {
30+ switch (this .toString ()) {
31+ case "aarch64" : return Architecture .AARCH64 ;
32+ case "x64" : return Architecture .X86_64 ;
33+ case "x86" : return Architecture .I386 ;
34+ default : return null ;
35+ }
36+ }
37+
38+ }
Original file line number Diff line number Diff line change 1111import org .redline_rpm .header .Os ;
1212import org .redline_rpm .header .RpmType ;
1313
14+ import io .github .fvarrui .javapackager .model .Arch ;
1415import io .github .fvarrui .javapackager .utils .FileUtils ;
1516import io .github .fvarrui .javapackager .utils .Logger ;
1617import io .github .fvarrui .javapackager .utils .VelocityUtils ;
@@ -42,7 +43,7 @@ protected File doApply(LinuxPackager packager) throws Exception {
4243 File executable = packager .getExecutable ();
4344 File assetsFolder = packager .getAssetsFolder ();
4445 String jreDirectoryName = packager .getJreDirectoryName ();
45- Architecture arch = Architecture . valueOf ( packager .getArch ().getRpm () );
46+ Architecture arch = packager .getArch ().toRpmArchitecture ( );
4647 File mimeXmlFile = packager .getMimeXmlFile ();
4748 File installationPath = packager .getLinuxConfig ().getInstallationPath ();
4849 File appPath = new File (installationPath , name );
You can’t perform that action at this time.
0 commit comments