-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
26 changed files
with
914 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gradle | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: build | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Java setup | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: 17 | ||
cache: "gradle" | ||
# - name: Set outputs | ||
# id: vars | ||
# run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- name: Build | ||
run: chmod +x ./gradlew && ./gradlew build | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: celestial | ||
path: build/libs/celestial-*.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/org/cubewhy/celestial/event/impl/AddonAddEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Celestial Launcher <me@lunarclient.top> | ||
* License under GPLv3 | ||
* Do NOT remove this note if you want to copy this file. | ||
*/ | ||
|
||
package org.cubewhy.celestial.event.impl; | ||
|
||
import org.cubewhy.celestial.event.Event; | ||
import org.cubewhy.celestial.game.BaseAddon; | ||
|
||
import java.io.File; | ||
|
||
public class AddonAddEvent extends Event { | ||
|
||
public final Type type; | ||
public final BaseAddon addon; | ||
|
||
public enum Type { | ||
JAVAAGENT, | ||
WEAVE, | ||
LUNARCN; | ||
} | ||
|
||
public AddonAddEvent(Type type, BaseAddon addon) { | ||
this.type = type; | ||
this.addon = addon; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/org/cubewhy/celestial/files/sources/DownloadSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Celestial Launcher <me@lunarclient.top> | ||
* License under GPLv3 | ||
* Do NOT remove this note if you want to copy this file. | ||
*/ | ||
|
||
package org.cubewhy.celestial.files.sources; | ||
|
||
import java.net.URL; | ||
|
||
public interface DownloadSource { | ||
// TODO complete this class | ||
URL getBaseURL(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Celestial Launcher <me@lunarclient.top> | ||
* License under GPLv3 | ||
* Do NOT remove this note if you want to copy this file. | ||
*/ | ||
|
||
package org.cubewhy.celestial.game; | ||
|
||
import org.apache.commons.io.FileUtils; | ||
import org.jetbrains.annotations.Contract; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
public abstract class BaseAddon { | ||
@Contract(pure = true) | ||
public static List<? extends BaseAddon> findAll() { | ||
return null; | ||
} | ||
|
||
protected static File autoCopy(File file, File folder) throws IOException { | ||
String name = file.getName(); | ||
if (!name.endsWith(".jar")) { | ||
name += ".jar"; // adds an ends with for the file | ||
} | ||
File target = new File(folder, name); | ||
if (target.exists()) { | ||
return null; | ||
} | ||
FileUtils.copyFile(file, target); | ||
return target; | ||
} | ||
} |
Oops, something went wrong.