Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #510

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c4367a1
Added missing static check before execution
sanidhya00081 Jan 9, 2025
3b0d4d5
Corrected the typo (task-> tasks) line 274
sanidhya00081 Jan 10, 2025
fc442af
Added the missing file, now the path is correct, in task: modifyAndCo…
sanidhya00081 Jan 12, 2025
95fde67
imported java.nio.file.Files and java.nio.file.Paths
sanidhya00081 Jan 12, 2025
d5a7bf8
Created the test file StaticCallToNonStaticTest.java
sanidhya00081 Jan 14, 2025
04b5b9d
I have made the suggested changes.
sanidhya00081 Jan 15, 2025
23459e9
Added a clean up method in StaticCallToNonStaticTest.java to handle t…
sanidhya00081 Jan 16, 2025
0df7b86
Removed the println statement
sanidhya00081 Jan 19, 2025
677160d
Corrected the directory of D.java
sanidhya00081 Jan 22, 2025
b2cfcad
Added back the missing java files.
sanidhya00081 Jan 23, 2025
b006cec
I again cloned raw build.gradle and made changes one at a time to che…
sanidhya00081 Jan 24, 2025
c06462f
Corrected te dependency issue I think this works as intended.
sanidhya00081 Jan 24, 2025
1decb36
I have tried adding a new target task named runModifiedTest that targ…
sanidhya00081 Jan 25, 2025
ab1b945
Merge branch 'javapathfinder:master' into master
sanidhya00081 Jan 27, 2025
892a4c7
Added new test target to Github action.
sanidhya00081 Jan 27, 2025
b758439
New test is targetting the StaticCallToNonStaticTest()
sanidhya00081 Jan 27, 2025
3f8c0ff
Removed the clean up method and moved settings.jason to .gitignore.
sanidhya00081 Jan 30, 2025
ab0e4b7
Removed the clean up method and moved settings.jason to .gitignore.
sanidhya00081 Jan 30, 2025
6685800
Removed the clean up method.
sanidhya00081 Jan 30, 2025
00a6308
Added static check condition in INVOKESTATIC.java.
sanidhya00081 Feb 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ tasks.named('jar') {
dependsOn(copyLibs)
dependsOn(copyResources)
}

tasks.named("test") {
dependsOn(tasks.named("modifyAndCompileD"))
}

tasks.register('compileModules', JavaCompile) {
dependsOn(copyLibs)
Expand Down Expand Up @@ -269,6 +271,33 @@ tasks.register('buildJars') {
dependsOn createRunJpfJar
dependsOn createRunTestJar
}
task.register("modifyAndCompileD") {
cyrille-artho marked this conversation as resolved.
Show resolved Hide resolved
// Declaring inputs and outputs to make the task compatible with the configuration cache
inputs.file("src/main/java/D.java")
outputs.dir("${buildDir}/classes/java/main")

doLast {
// Step 1: Defining file paths
def originalFile = "src/main/java/D.java"
def tempDir = file("${buildDir}/tempD")
def buildClassesDir = file("${buildDir}/classes/java/main")

// Step 2: Creating a temporary directory
tempDir.mkdirs()

// Step 3: Modifying D.java by removing the "static" keyword
def modifiedFile = file("${sourceDir}/D.java")
modifiedFile.text = originalFile.text.replace("static ", "")

// Step 4: Compiling the modified D.java
def javac = org.gradle.internal.jvm.Jvm.current().javacExecutable
exec {
commandLine javac, "-d", buildClassesDir, modifiedFile
}

println "Modified and recompiled D.java without 'static'."
}
}

test {
description = "Runs core regression tests."
Expand Down
Loading