Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

Commit

Permalink
Merge github.com:CoolCrabs/brachyura
Browse files Browse the repository at this point in the history
  • Loading branch information
Geolykt committed Apr 12, 2022
2 parents f358f51 + 9728fec commit e8fe913
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion brachyura/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.github.coolcrabs</groupId>
<artifactId>brachyura</artifactId>
<version>0.75.0</version>
<version>0.76.0</version>

<properties>
<java.version>1.8</java.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ public void process(Collection<ProcessingEntry> inputs, ProcessingSink sink) thr
}

// TODO: this doesn't need to write files to disk
@NotNull
public ProcessorChain resourcesProcessingChain(List<JavaJarDependency> jij) {
Path fmjgen = getLocalBrachyuraPath().resolve("fmjgen");
if (Files.exists(fmjgen)) PathUtil.deleteDirectory(fmjgen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.github.coolcrabs.brachyura.maven.publish.AuthentificatedMavenPublishRepository;
import io.github.coolcrabs.brachyura.maven.publish.MavenPublisher;
import io.github.coolcrabs.brachyura.minecraft.VersionMeta;
import io.github.coolcrabs.brachyura.processing.ProcessorChain;
import io.github.coolcrabs.brachyura.processing.sinks.AtomicZipProcessingSink;
import io.github.coolcrabs.brachyura.processing.sources.DirectoryProcessingSource;
import io.github.coolcrabs.brachyura.project.Task;
Expand Down Expand Up @@ -229,12 +230,17 @@ public void getPublishTasks(Consumer<Task> p) {
return new @NotNull IdeModule[]{module.get().ideModule()};
}

@NotNull
public ProcessorChain resourcesProcessingChain() {
return context.get().resourcesProcessingChain(jijList);
}

@NotNull
public JavaJarDependency build() {
try {
try (AtomicZipProcessingSink out = new AtomicZipProcessingSink(getBuildJarPath())) {
context.get().modDependencies.get(); // Ugly hack
context.get().resourcesProcessingChain(jijList).apply(out, Arrays.stream(getResourceDirs()).map(DirectoryProcessingSource::new).collect(Collectors.toList()));
resourcesProcessingChain().apply(out, Arrays.stream(getResourceDirs()).map(DirectoryProcessingSource::new).collect(Collectors.toList()));
context.get().getRemappedClasses(module.get()).values().forEach(s -> s.getInputs(out));
out.commit();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ private JvmUtil() { }

static {
// https://stackoverflow.com/a/2591122
String version = System.getProperty("java.version");
// Changed to java.specification.version to avoid -ea and other various odditites
// See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/System.html#getProperties()
// and https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runtime.Version.html
String version = System.getProperty("java.specification.version");
if (version.startsWith("1.")) {
version = version.substring(2, 3);
} else {
Expand Down

0 comments on commit e8fe913

Please sign in to comment.