Skip to content

Commit

Permalink
Move replaceTokens to post task classes stage
Browse files Browse the repository at this point in the history
Signed-off-by: Hendrix-Shen <HendrixShen@hendrixshen.top>
  • Loading branch information
Hendrix-Shen committed Aug 21, 2023
1 parent cf13f8b commit 0a3f564
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,12 @@ ImmutableList<Object> replaceTokenFile = ImmutableList.builder()
.add("MagicLibReference")
.build()

jar {
doFirst {
tasks.classes {
doLast {
File dir = file("build/classes/java")

dir.eachFileRecurse {
String path = it.path.replace(file("build/classes/java").path, "")
String path = it.path.replace(dir.path, "")

if (path.endsWith(".class") && replaceTokenFile.stream().anyMatch { path.contains(it as String) }) {
ClassReader cr = new ClassReader(it.newInputStream().bytes)
Expand Down

0 comments on commit 0a3f564

Please sign in to comment.