Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
409 commits
Select commit Hold shift + click to select a range
ee9ec50
[skip ci] Use different Java versions for CI build
Gaming32 Feb 12, 2022
6ac9347
Work on replacing imports automatically
Gaming32 Feb 12, 2022
8fb157c
Move visuals package
Gaming32 Feb 12, 2022
9b7970e
[no ci] Remove outdated information from the README
Gaming32 Feb 12, 2022
ce447e5
Delete Shuffles copy.java
Gaming32 Feb 12, 2022
48a4fcd
Update license some
Gaming32 Feb 12, 2022
471946b
More license
Gaming32 Feb 12, 2022
f6e8194
Move prompts
Gaming32 Feb 13, 2022
00a0df0
Update SortAnalyzer.java
Gaming32 Feb 13, 2022
e540f57
Update UtilFrame.java
Gaming32 Feb 13, 2022
f41bab5
Move frames
Gaming32 Feb 13, 2022
804ee4d
Move dialogs
Gaming32 Feb 13, 2022
eab0111
Styling fixes
Gaming32 Feb 13, 2022
a7575a3
Move panes
Gaming32 Feb 13, 2022
1e045be
Deprecate Sort.setComparisonBased(boolean)
Gaming32 Feb 14, 2022
4403cfc
Move threads
Gaming32 Feb 15, 2022
5ad6c80
Move sorts
Gaming32 Feb 15, 2022
650073e
Move main
Gaming32 Feb 15, 2022
ad298f8
Move utils
Gaming32 Feb 15, 2022
0f261d9
Initial Maven setup
Gaming32 Feb 16, 2022
312220a
Remove .settings
Gaming32 Feb 16, 2022
f7cf631
Remove lib
Gaming32 Feb 16, 2022
fa597cd
Update launch.json
Gaming32 Feb 16, 2022
0f9916d
Fix workflow
Gaming32 Feb 16, 2022
55026af
Fix name
Gaming32 Feb 16, 2022
8dbad96
[skip ci] Update README and run
Gaming32 Feb 16, 2022
93440da
[skip ci] Update README
Gaming32 Feb 16, 2022
9aeafda
Redo run scripts
Gaming32 Feb 16, 2022
1e1ca93
Fix permissions
Gaming32 Feb 16, 2022
b653720
Merge pull request #78 from Gaming32/maven-5.0
Gaming32 Feb 18, 2022
0cc5804
Fix install extra sorts bug
Gaming32 Feb 18, 2022
572446a
Update classgraph
Gaming32 Feb 19, 2022
3d6b134
Bump version
Gaming32 Feb 19, 2022
cbf3109
Add dependency
Gaming32 Feb 19, 2022
807b5dd
Reset version
Gaming32 Feb 19, 2022
3e913a5
Migrate to using SortInfo more
Gaming32 Feb 19, 2022
6b7e47b
Merge branch 'main' into groovy-scripting
Gaming32 Feb 19, 2022
ff20f58
Create ScriptManager
Gaming32 Feb 19, 2022
1feeb4e
Rename fields
Gaming32 Feb 19, 2022
bf1e435
Get a working thing
Gaming32 Feb 19, 2022
9e05ac0
Fix frame sizing inconsistences
Gaming32 Feb 19, 2022
7092fe4
Load script files from the GUI
Gaming32 Feb 19, 2022
41dbbec
Add getSort()
Gaming32 Feb 19, 2022
2794391
Add star import
Gaming32 Feb 19, 2022
0a274eb
Add ability to reference sorts directly
Gaming32 Feb 20, 2022
ca35cbb
Create SortInfo.Builder
Gaming32 Feb 20, 2022
5f7d2a1
Add newSort method
Gaming32 Feb 20, 2022
ecf43f0
Fix some bugs
Gaming32 Feb 20, 2022
a30d9d4
Fix missing .git build issues
Gaming32 Feb 20, 2022
08f0dc2
Fix naming
Gaming32 Feb 20, 2022
3fd00c9
Add run method
Gaming32 Feb 20, 2022
1eb6f70
Running improvements
Gaming32 Feb 20, 2022
f47d828
Add sort group running system
Gaming32 Feb 20, 2022
6a89251
Minor improvements
Gaming32 Feb 20, 2022
eb579f7
Add basic event management system
Gaming32 Feb 21, 2022
064c696
Add builtin script system
Gaming32 Feb 21, 2022
376281a
Setup new sort thread basics
Gaming32 Feb 21, 2022
ca7c9d5
Create distribute sort thread
Gaming32 Feb 21, 2022
562d84f
Begin concurrent.groovy
Gaming32 Feb 21, 2022
83bc1d1
Make some improvements to prepare for Showcase
Gaming32 Feb 21, 2022
9ff8338
Finish concurrent.groovy
Gaming32 Feb 21, 2022
798eff5
Remove unnecessary constant
Gaming32 Feb 21, 2022
71fc1dc
Remove unnecessary indent
Gaming32 Feb 21, 2022
0d407f4
Make run optionally more code-y
Gaming32 Feb 21, 2022
93514ce
exchange.groovy
Gaming32 Feb 21, 2022
6f8848e
Add hybrid.groovy
Gaming32 Feb 22, 2022
ffaaf79
Fix TimSort usage
Gaming32 Feb 22, 2022
8047326
Update SortPrompt.java
Gaming32 Feb 22, 2022
e0b0058
impractical.groovy
Gaming32 Feb 22, 2022
eaa091e
Begin work on checkstyle
Gaming32 Feb 24, 2022
701ad38
Update checkstyle.yml
Gaming32 Feb 24, 2022
1ad8483
[skip ci] Remove unused config
Gaming32 Feb 24, 2022
756badb
Improve checkstyle.xml
Gaming32 Feb 24, 2022
810a179
Some improvements
Gaming32 Feb 24, 2022
e7424e4
Update pom.xml
Gaming32 Feb 24, 2022
7b438af
Create extensions.json
Gaming32 Feb 24, 2022
d7e3a95
Fix VisualStyles.java
Gaming32 Feb 24, 2022
e6d6aee
Fix Timer.java
Gaming32 Feb 24, 2022
3929fa8
Fix Delays.java
Gaming32 Feb 24, 2022
f5aed64
Merge branch 'checkstyle' of https://github.com/Gaming32/ArrayV into …
Gaming32 Feb 24, 2022
4004f11
A few quick updates
Gaming32 Feb 24, 2022
2284a38
Fix Visual.java
Gaming32 Feb 24, 2022
b466615
Fix PerlinNoise.java
Gaming32 Feb 25, 2022
a9338e4
Fix PixelMesh.java
Gaming32 Feb 25, 2022
8217213
Fix HoopStack.java
Gaming32 Feb 25, 2022
f534887
Fix CustomImage.java
Gaming32 Feb 25, 2022
794111a
Fix WaveDots.java
Gaming32 Feb 25, 2022
cf3162e
Fix SpiralDots.java
Gaming32 Feb 25, 2022
c1735b3
Fix ScatterPlot.java
Gaming32 Feb 25, 2022
4a7633d
Fix DisparityDots.java
Gaming32 Feb 25, 2022
bdddaaf
Add trailing whitespace module
Gaming32 Feb 25, 2022
ffe7e3c
Fix Spiral.java
Gaming32 Feb 25, 2022
0c84b90
Fix DisparityCircle.java
Gaming32 Feb 25, 2022
4d15cc9
Fix DisparityChords.java
Gaming32 Feb 25, 2022
dd96a60
Fix ColorCircle.java
Gaming32 Feb 25, 2022
2b0fe35
Fix SineWave.java
Gaming32 Feb 25, 2022
d61629c
Fix Rainbow.java
Gaming32 Feb 25, 2022
bfe0e07
Fix DisparityBarGraph.java
Gaming32 Feb 25, 2022
be291f4
Fix BarGraph.java
Gaming32 Feb 25, 2022
43b5369
Fix Writes.java
Gaming32 Feb 25, 2022
099900c
Fix Statistics.java
Gaming32 Feb 25, 2022
7e55df6
Fix Sounds.java
Gaming32 Feb 25, 2022
5cc9525
Fix SortingNetworkGenerator.java
Gaming32 Feb 25, 2022
c7a069e
Fix GraphReader.java
Gaming32 Feb 25, 2022
5bca5eb
Fix GraphNode.java
Gaming32 Feb 25, 2022
117ddd6
Fix GraphConnection.java
Gaming32 Feb 25, 2022
c0d4f7e
Fix AWTUtils.java
Gaming32 Feb 25, 2022
0523894
Fix Shuffles.java
Gaming32 Feb 25, 2022
59b2c88
Fix ShuffleGraph.java
Gaming32 Feb 25, 2022
135c077
Fix Rotations.java
Gaming32 Feb 25, 2022
958d7b7
Fix Renderer.java
Gaming32 Feb 25, 2022
a4936a1
Fix Reads.java
Gaming32 Feb 25, 2022
83a2bf0
Fix MultipleScript.java
Gaming32 Feb 25, 2022
456dee5
Fix m.java
Gaming32 Feb 25, 2022
80e1e02
Fix IndexedRotations.java
Gaming32 Feb 25, 2022
71201d7
Fix Highlights.java
Gaming32 Feb 25, 2022
e406013
Fix Distributions.java
Gaming32 Feb 25, 2022
c378260
Fix ArrayVList.java
Gaming32 Feb 25, 2022
50557e5
Fix ArrayFileWriter.java
Gaming32 Feb 25, 2022
18153cb
Fix threads
Gaming32 Feb 25, 2022
302b4c7
[skip ci] Add workflow results to README
Gaming32 Feb 25, 2022
886bcb0
Update pom.xml
Gaming32 Feb 25, 2022
b866dbf
Fix ViewPrompt.java
Gaming32 Feb 25, 2022
33e5eeb
Fix SortPrompt.java
Gaming32 Feb 25, 2022
677660d
Fix ShufflePrompt.java
Gaming32 Feb 25, 2022
e3319c8
Fix JErrorPane.java
Gaming32 Feb 25, 2022
b1aa9cc
Fix JEnhancedOptionPane.java
Gaming32 Feb 25, 2022
3da5ee5
Fix ShufflePanel.java
Gaming32 Feb 25, 2022
31367cf
Fix SortAnalyzer.java
Gaming32 Feb 25, 2022
46c72fd
Fix ArrayVisualizer.java
Gaming32 Feb 25, 2022
525689b
Fix broken @checkstyle:off marks
Gaming32 Feb 25, 2022
2848b86
Fix ArrayManager.java
Gaming32 Feb 25, 2022
39ec46b
Fix UtilFrame.java
Gaming32 Feb 25, 2022
4b6d33e
Fix SoundFrame.java
Gaming32 Feb 25, 2022
cdf1405
Fix ImageFrame.java
Gaming32 Feb 25, 2022
2bc4777
Fix ArrayFrame.java
Gaming32 Feb 25, 2022
c70deee
Fix AppFrame.java
Gaming32 Feb 25, 2022
dca8e77
Fix ShuffleDialog.java
Gaming32 Feb 25, 2022
b1c8f77
Fix ViewPrompt.java
Gaming32 Feb 25, 2022
5927587
Add FileTabCharacter
Gaming32 Feb 25, 2022
77ba70f
Merge pull request #81 from Gaming32/checkstyle
Gaming32 Feb 26, 2022
26918ca
Merge branch 'main' into groovy-scripting
Gaming32 Feb 26, 2022
e4c3b5f
Fix checkstyle warnings
Gaming32 Feb 26, 2022
ed22e02
Fix Linux issues with the checkstyle VS Code extension
Gaming32 Feb 26, 2022
15b1c36
Fix broken ArrayV
Gaming32 Feb 26, 2022
021d8ac
Merge branch 'main' into groovy-scripting
Gaming32 Feb 26, 2022
9369102
Fix TimSort
Gaming32 Feb 26, 2022
7020fb1
insertion.groovy
Gaming32 Feb 26, 2022
d50b3e2
merge.groovy
Gaming32 Feb 26, 2022
32c32d4
misc.groovy
Gaming32 Feb 26, 2022
7169b34
quick.groovy
Gaming32 Feb 26, 2022
6aa3a8f
Fix issue waiting to happen
Gaming32 Feb 26, 2022
6939dee
selection.groovy
Gaming32 Feb 26, 2022
3b072c8
Remove Run All
Gaming32 Feb 26, 2022
d6ee9a2
Implement Run All
Gaming32 Feb 26, 2022
58bf7fa
Reorder categories
Gaming32 Feb 26, 2022
ce7caba
Remove old scripting API
Gaming32 Feb 26, 2022
db2d0d2
Remove old scripting API scripts
Gaming32 Feb 26, 2022
f714870
Improve script load failing error message
Gaming32 Feb 26, 2022
b328549
Make custom sort API usable
Gaming32 Feb 26, 2022
7af954c
Improve API further
Gaming32 Feb 26, 2022
13016ba
Generate javadocs
Gaming32 Mar 2, 2022
1d91b2c
Generate more javadocs
Gaming32 Mar 2, 2022
ecbb529
Write javadocs for GroovyLocals
Gaming32 Mar 2, 2022
560585a
Document groovyapi
Gaming32 Mar 2, 2022
35c864f
Document ArrayVEventHandler
Gaming32 Mar 2, 2022
5664c95
Document ArrayVScript
Gaming32 Mar 2, 2022
14a0dab
Document RunGroupContext
Gaming32 Mar 2, 2022
4edfc91
Document RunSortBuilder
Gaming32 Mar 3, 2022
808ff42
Document RunSortInfoExtension
Gaming32 Mar 3, 2022
e7afadb
Make ScriptManager.ScriptThread static
Gaming32 Mar 3, 2022
ce440ae
Generate javadoc for Sort
Gaming32 Mar 3, 2022
d55bfe1
Expose closer API
Gaming32 Mar 3, 2022
83d1429
Document ScriptManager
Gaming32 Mar 4, 2022
9058392
I missed a method
Gaming32 Mar 4, 2022
d373797
Update ScriptManager.java
Gaming32 Mar 4, 2022
085abe3
Delete MultipleSortThread.java
Gaming32 Mar 5, 2022
4aba24b
Fix typo
Gaming32 Mar 5, 2022
3dd74a0
Move RunSort to main
Gaming32 Mar 12, 2022
df0c26f
Make ternaries in builtin scripts match with the rest of the scripts
Gaming32 Mar 12, 2022
a4cd143
Move run script button to bottom
Gaming32 Mar 12, 2022
02c1398
Change spacing with Run Script button
Gaming32 Mar 19, 2022
8a312ce
Use "speed" instead of "delay" in Groovy API
Gaming32 Mar 19, 2022
2348fb8
Bump Groovy
Gaming32 Mar 19, 2022
80f75d0
Change go() to run() and make it accept options
Gaming32 Mar 19, 2022
11eddfd
Remove accidentally commited test files
Gaming32 Mar 19, 2022
ae9fa97
Fix checkstyle error
Gaming32 Mar 19, 2022
d82d431
[no ci] Basic stepping implementation
Gaming32 Mar 30, 2022
8e50158
Implement stepping on Highlights
Gaming32 Mar 30, 2022
d7d3472
Merge branch 'main' into groovy-scripting
Gaming32 Mar 30, 2022
5054f51
Move some methods around
Gaming32 Apr 3, 2022
b4aa443
Revamp RunSortBuilder somewhat
Gaming32 Apr 4, 2022
bd9ee6b
Reduce complexity and make go return the builder
Gaming32 Apr 4, 2022
57bb8e3
Merge pull request #82 from Gaming32/groovy-scripting
EmeraldBlock Apr 4, 2022
f82d32e
Add hashCode, equals, and toString to SortInfo
Gaming32 Apr 10, 2022
b511933
Bump version
Gaming32 Apr 10, 2022
2857eea
Bump version
Gaming32 Apr 11, 2022
a54b713
Display version name in title bar
Gaming32 Apr 11, 2022
a508643
Create SortMeta.java
Gaming32 Apr 11, 2022
810ab58
Update SortMeta.java
Gaming32 Apr 11, 2022
0db4653
Make SortInfo support the annotations
Gaming32 Apr 11, 2022
0320146
Migrate Tim Sort to SortMeta and fix a bug
Gaming32 Apr 11, 2022
0d82b20
Make everything work properly
Gaming32 Apr 11, 2022
c358255
Move the questions API
Gaming32 Apr 12, 2022
6909c6a
Deprecate the old question API
Gaming32 Apr 12, 2022
238c9e3
Migrate template to use SortMeta
Gaming32 Apr 12, 2022
195e5ba
Fix #84
Gaming32 Apr 12, 2022
2e24630
Regenerate hashCode and equals for SortInfo
Gaming32 Apr 12, 2022
b2615f3
Deprecate old Sort getters
Gaming32 Apr 12, 2022
372b258
Remove old default assignments
Gaming32 Apr 12, 2022
d35c33c
Don't store data in the deprecated way if we don't have to
Gaming32 Apr 12, 2022
36ba8bc
Fix checkstyle violations in Sort.java
Gaming32 Apr 12, 2022
523ca6b
Deprecate setters
Gaming32 Apr 12, 2022
b49c83f
Stop supporting the deprecated metadata format in the Groovy API
Gaming32 Apr 12, 2022
98e7bdc
Remove explicit "isSlowSort"
Gaming32 Apr 12, 2022
e147232
Migrate a bunch of sorts
Gaming32 Apr 12, 2022
e33c831
Can load sort category from package
Gaming32 Apr 15, 2022
a1a4c77
Remove unnecessary category declarations
Gaming32 Apr 15, 2022
fe925a9
Some cleanup
Gaming32 Apr 15, 2022
7fbce24
Finish migrating concurrent
Gaming32 Apr 15, 2022
d9de416
Migrate tests
Gaming32 Apr 15, 2022
1fff00f
Notify users that they need a JDK to import sorts
Gaming32 Apr 15, 2022
ea867e6
Fix file dialogs
Gaming32 Apr 15, 2022
b64afde
Create log files for failed imports
Gaming32 Apr 15, 2022
8b45249
Fix sort imports
Gaming32 Apr 15, 2022
5a79051
Improve package detection
Gaming32 Apr 15, 2022
081acc4
Migrate quick
Gaming32 Apr 15, 2022
3e6637c
Hide, but don't warn about, disabled sorts
Gaming32 Apr 15, 2022
a877640
Migrate misc
Gaming32 Apr 15, 2022
23c008c
Fix bug
Gaming32 Apr 16, 2022
4b6183b
Merge branch 'main' into annotation-metadata
Gaming32 Apr 17, 2022
386d85f
Fix inconsistency
Gaming32 Jul 9, 2022
35b79da
Update Groovy
Gaming32 Nov 24, 2022
d3ef44f
Fix missing unreasonable limit
Gaming32 Jan 2, 2023
288e051
Merge remote-tracking branch 'origin/annotation-metadata' into annota…
Gaming32 Jan 2, 2023
99a0c38
Fix typo
Gaming32 Jan 2, 2023
8a7a9ec
Add colon
Gaming32 Jan 2, 2023
31172c2
Add base in Base-N Max Heap
Gaming32 Jan 2, 2023
1d1a38c
Fix grammatical error
Gaming32 Jan 4, 2023
9085977
Change BeforeExecutionExclusionFileFilter regex
Gaming32 Jan 4, 2023
aa06ade
Rename "SortInfo sort" variable
Gaming32 Jan 4, 2023
01ec82b
Change import sort message
Gaming32 Jan 13, 2023
0a7a4fb
Merge pull request #86 from Gaming32/annotation-metadata
Gaming32 Jan 16, 2023
89fcea4
Cleanup code a bunch
Gaming32 Jan 16, 2023
d325673
Build on Java 19 as well
Gaming32 Jan 16, 2023
a999198
https://github.com/badges/shields/issues/8671
Gaming32 Feb 8, 2023
6202fe3
Bump dependencies
Gaming32 Oct 8, 2023
151badf
Change Java versions used for CI
Gaming32 Oct 8, 2023
c90c065
Bump dependencies
Gaming32 Apr 18, 2024
74f6ada
Update maven-compiler-plugin
Gaming32 May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 0 additions & 13 deletions .classpath

This file was deleted.

22 changes: 4 additions & 18 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
antw text eol=lf
run text eol=lf

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
antw.bat text eol=crlf
run.bat text eol=crlf
15 changes: 15 additions & 0 deletions .github/workflows/checkstyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: checkstyle
on: [pull_request, push, workflow_dispatch]

jobs:
checkstyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2.1.0
with:
java-version: 8
distribution: zulu
- name: Run checkstyle with Maven
run: mvn -Dcheckstyle.violationSeverity=warning checkstyle:check
22 changes: 6 additions & 16 deletions .github/workflows/ant.yml → .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: ant
on: [pull_request, push]
name: maven
on: [pull_request, push, workflow_dispatch]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
8, # Minimum supported
11, # Current Java LTS
15, # Last version
16 # Most recent version
]
java: [8, 11, 17, 21]
# and run on both Linux and Windows
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
Expand All @@ -22,16 +17,11 @@ jobs:
with:
java-version: ${{ matrix.java }}
distribution: zulu
- name: Build with Ant
run: ant -noinput -buildfile build.xml
- name: Build standalone JAR
if: ${{ matrix.java == 8 && matrix.os == 'ubuntu-latest' }}
run: |
cd dist
ant -noinput -buildfile build.xml
- name: Build with Maven
run: mvn clean install
- name: Upload artifact
uses: actions/upload-artifact@v2
if: ${{ matrix.java == 8 && matrix.os == 'ubuntu-latest' }}
with:
name: standalone-jar
path: dist/arrayVisualizer.jar
path: target/ArrayV-*.jar
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
*.class
/bin/
target
__pycache__
cache
antiqsort_*
network_*.svg
sorting_networks
/stats-config.txt
dependency-reduced-pom.xml
/scripts
.idea/
*.iml
117 changes: 117 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}

}
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
28 changes: 0 additions & 28 deletions .project

This file was deleted.

15 changes: 0 additions & 15 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

2 changes: 0 additions & 2 deletions .settings/org.eclipse.jdt.ui.prefs

This file was deleted.

2 changes: 0 additions & 2 deletions .settings/org.eclipse.ltk.core.refactoring.prefs

This file was deleted.

6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"vscjava.vscode-java-pack",
"shengchen.vscode-checkstyle"
]
}
Loading