48
49 PackageType(String packageName, String bundleSuffix, String bundlerClass) {
50 name = packageName;
51 suffix = bundleSuffix;
52 if (bundlerClass != null && !Inner.DISABLED_PACKAGERS.contains(getName())) {
53 supported = isBundlerSupported(bundlerClass);
54 } else {
55 supported = false;
56 }
57
58 if (suffix != null && supported) {
59 TKit.trace(String.format("Bundler %s supported", getName()));
60 }
61 }
62
63 PackageType(String bundleSuffix, String bundlerClass) {
64 this(bundleSuffix.substring(1), bundleSuffix, bundlerClass);
65 }
66
67 void applyTo(JPackageCommand cmd) {
68 cmd.addArguments("--type", getName());
69 }
70
71 String getSuffix() {
72 return suffix;
73 }
74
75 boolean isSupported() {
76 return supported;
77 }
78
79 String getName() {
80 return name;
81 }
82
83 static PackageType fromSuffix(String packageFilename) {
84 if (packageFilename != null) {
85 for (PackageType v : values()) {
86 if (packageFilename.endsWith(v.getSuffix())) {
87 return v;
88 }
|
48
49 PackageType(String packageName, String bundleSuffix, String bundlerClass) {
50 name = packageName;
51 suffix = bundleSuffix;
52 if (bundlerClass != null && !Inner.DISABLED_PACKAGERS.contains(getName())) {
53 supported = isBundlerSupported(bundlerClass);
54 } else {
55 supported = false;
56 }
57
58 if (suffix != null && supported) {
59 TKit.trace(String.format("Bundler %s supported", getName()));
60 }
61 }
62
63 PackageType(String bundleSuffix, String bundlerClass) {
64 this(bundleSuffix.substring(1), bundleSuffix, bundlerClass);
65 }
66
67 void applyTo(JPackageCommand cmd) {
68 cmd.setArgumentValue("--type", getName());
69 }
70
71 String getSuffix() {
72 return suffix;
73 }
74
75 boolean isSupported() {
76 return supported;
77 }
78
79 String getName() {
80 return name;
81 }
82
83 static PackageType fromSuffix(String packageFilename) {
84 if (packageFilename != null) {
85 for (PackageType v : values()) {
86 if (packageFilename.endsWith(v.getSuffix())) {
87 return v;
88 }
|