Skip to content

Commit

Permalink
CopyJars: add additional archs
Browse files Browse the repository at this point in the history
This is a quickfix until #21 is resolved. When an arch is not present in
the regular expression, the arch modifier is interpreted as part of the
version string, resulting in bogus behavior.
  • Loading branch information
stelfrich committed Sep 23, 2019
1 parent efc7ad1 commit 1e472af
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ private static boolean isIJ1Plugin(final File file) {

private final static Pattern versionPattern = Pattern.compile("(.+?)"
+ "(-\\d+(\\.\\d+|\\d{7})+[a-z]?\\d?(-[A-Za-z0-9.]+?|\\.GA)*?)?"
+ "((-(swing|swt|sources|javadoc|native|linux-x86|linux-x86_64|macosx-x86_64|windows-x86|windows-x86_64|android-arm|android-x86|natives-windows|natives-macos|natives-linux))?(\\.jar(-[a-z]*)?))");
+ "((-(swing|swt|sources|javadoc|native|linux-x86|linux-x86_64|linux-armhf|linux-ppc64le|macosx-x86_64|windows-x86|windows-x86_64|android-x86|android-x86_64|android-arm|android-arm64|ios-x86_64|ios-arm64|natives-windows|natives-macos|natives-linux))?(\\.jar(-[a-z]*)?))");

This comment has been minimized.

Copy link
@ctrueden

ctrueden Sep 23, 2019

Member

Instead of hardcoding all these archs, how about using linux-\\w* instead? And android-[0-9a-zA-Z_-]*, windows-[0-9a-zA-Z_-]*, macosx-[0-9a-zA-Z_-]*. Then we won't have to keep expanding it.

This comment has been minimized.

Copy link
@ctrueden

ctrueden Sep 23, 2019

Member

Also, we should reconcile with VersionUtils; see e.g. scijava/scijava-common@32c4098

private final static int PREFIX_INDEX = 1;
private final static int VERSION_INDEX = 2;
private final static int SUFFIX_INDEX = 5;
Expand Down

0 comments on commit 1e472af

Please sign in to comment.