-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Begin work on ASM-based remapper and gradle plugin
- Loading branch information
1 parent
32e03c1
commit 9ebb4d1
Showing
18 changed files
with
586 additions
and
175 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
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
52 changes: 0 additions & 52 deletions
52
compile/src/asm/java/dev/lukebemish/opensesame/compile/asm/Processor.java
This file was deleted.
Oops, something went wrong.
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
4 changes: 1 addition & 3 deletions
4
plugin/src/main/java/dev/lukebemish/opensesame/plugin/OpenSesamePlugin.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 |
---|---|---|
@@ -1,14 +1,12 @@ | ||
package dev.lukebemish.opensesame.plugin; | ||
|
||
import dev.lukebemish.opensesame.plugin.loom.LoomExtension; | ||
import org.gradle.api.Plugin; | ||
import org.gradle.api.Project; | ||
import org.gradle.api.plugins.ExtensionAware; | ||
|
||
public class OpenSesamePlugin implements Plugin<Project> { | ||
@Override | ||
public void apply(Project target) { | ||
var openSesameExtension = target.getExtensions().create("opensesame", OpenSesameExtension.class); | ||
((ExtensionAware) openSesameExtension).getExtensions().create("loom", LoomExtension.class); | ||
//((ExtensionAware) openSesameExtension).getExtensions().create("loom", LoomExtension.class); | ||
} | ||
} |
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
plugin/src/main/java/dev/lukebemish/opensesame/plugin/task/ProcessAnnotationsTask.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 @@ | ||
package dev.lukebemish.opensesame.plugin.task; | ||
|
||
import dev.lukebemish.opensesame.compile.asm.VisitingOpenProcessor; | ||
import org.gradle.api.DefaultTask; | ||
import org.gradle.api.file.DirectoryProperty; | ||
import org.gradle.api.tasks.InputDirectory; | ||
import org.gradle.api.tasks.OutputDirectory; | ||
import org.gradle.api.tasks.TaskAction; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
|
||
public abstract class ProcessAnnotationsTask extends DefaultTask { | ||
@InputDirectory | ||
public abstract DirectoryProperty getInputClassesDir(); | ||
|
||
@OutputDirectory | ||
public abstract DirectoryProperty getOutputClassesDir(); | ||
|
||
@TaskAction | ||
public void process() { | ||
try { | ||
Path inPath = getInputClassesDir().get().getAsFile().toPath(); | ||
Path outPath = getOutputClassesDir().get().getAsFile().toPath(); | ||
VisitingOpenProcessor.process(inPath, outPath); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
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,60 @@ | ||
plugins { | ||
id 'java' | ||
id 'groovy' | ||
id 'dev.lukebemish.opensesame' | ||
} | ||
|
||
group='dev.lukebemish.opensesame' | ||
|
||
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17)) | ||
|
||
configurations { | ||
testSource { | ||
canBeResolved = true | ||
} | ||
testModuleClasspath { | ||
canBeResolved = true | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testSource('dev.lukebemish.opensesame:testtargets:testsources') { | ||
attributes { | ||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, 'java-source')) | ||
} | ||
} | ||
testImplementation 'dev.lukebemish.opensesame:testtargets' | ||
testModuleClasspath 'dev.lukebemish.opensesame:testtargets' | ||
testImplementation 'dev.lukebemish.opensesame:opensesame-core' | ||
testImplementation libs.asm | ||
testImplementation libs.junit.api | ||
testRuntimeOnly libs.junit.engine | ||
} | ||
|
||
opensesame.apply(sourceSets.test) | ||
|
||
tasks.named('compileTestJava', JavaCompile).configure { | ||
dependsOn(configurations.testSource) | ||
source(configurations.testSource) | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
|
||
testLogging { | ||
showStandardStreams = true | ||
exceptionFormat = 'full' | ||
events = ['passed', 'failed', 'skipped'] | ||
} | ||
|
||
testClassesDirs += files( | ||
sourceSets.test.output, | ||
configurations.testModuleClasspath | ||
) | ||
|
||
outputs.upToDateWhen {false} | ||
} |
Binary file not shown.
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 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.