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

Use createCloneTask for templateTest and demoTest #1052

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ ext {
plumeScriptsHome = "${project(':checker').projectDir}/bin-devel/.plume-scripts"
htmlToolsHome = "${project(':checker').projectDir}/bin-devel/.html-tools"
doLikeJavacHome = "${project(':checker').projectDir}/bin/.do-like-javac"
templateforCheckerDir = "${parentDir}/templatefora-checker"
demosDir = "${parentDir}/checker-framework.demos"

javadocMemberLevel = JavadocMemberLevel.PROTECTED

Expand Down Expand Up @@ -865,7 +867,8 @@ createCloneTask('getGitScripts', 'https://github.com/eisop-plume-lib/git-scripts
createCloneTask('getPlumeScripts', 'https://github.com/eisop-plume-lib/plume-scripts.git', plumeScriptsHome)
createCloneTask('getHtmlTools', 'https://github.com/plume-lib/html-tools.git', htmlToolsHome)
createCloneTask('getDoLikeJavac', 'https://github.com/opprop/do-like-javac.git', doLikeJavacHome)

createCloneTask('getTemplatefora-checker', 'https://github.com/eisop/templatefora-checker.git', templateforCheckerDir)
createCloneTask('getDemos', 'https://github.com/eisop/checker-framework.demos.git', demosDir)

// No group so it does not show up in the output of `gradlew tasks`
task pythonIsInstalled(type: Exec) {
Expand Down
50 changes: 6 additions & 44 deletions checker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -327,28 +327,9 @@ task demosTests(dependsOn: assembleForJavac, group: 'Verification') {
def injected = project.objects.newInstance(InjectedExecOps)

doLast {
File demosDir = new File(projectDir, '../../checker-framework.demos');
if (!demosDir.exists()) {
injected.execOps.exec {
workingDir file(demosDir.toString() + '/../')
executable 'git'
args = [
'clone',
'--depth',
'1',
'https://github.com/eisop/checker-framework.demos.git'
]
}
} else {
injected.execOps.exec {
workingDir demosDir
executable 'git'
args = [
'pull',
'https://github.com/eisop/checker-framework.demos.git'
]
ignoreExitValue = true
}
injected.execOps.exec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think exec-ing another task is ideal. Shouldn't it just be listed in dependsOn?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we can move this it to dependson like dependsOn: ['assembleForJavac', ':getDemos']

workingDir = rootDir
commandLine "./gradlew", "getDemos"
}
ant.properties.put('checker.lib', file("${projectDir}/dist/checker.jar").absolutePath)
ant.ant(dir: demosDir.toString())
Expand All @@ -361,28 +342,9 @@ task templateTests(dependsOn: assembleForJavac, group: 'Verification') {
def injected = project.objects.newInstance(InjectedExecOps)

doLast {
File templateforCheckerDir = new File(projectDir, '../../templatefora-checker');
if (!templateforCheckerDir.exists()) {
injected.execOps.exec {
workingDir file(templateforCheckerDir.toString() + '/../')
executable 'git'
args = [
'clone',
'--depth',
'1',
'https://github.com/eisop/templatefora-checker.git'
]
}
} else {
injected.execOps.exec {
workingDir templateforCheckerDir
executable 'git'
args = [
'pull',
'https://github.com/eisop/templatefora-checker.git'
]
ignoreExitValue = true
}
injected.execOps.exec {
workingDir = rootDir
commandLine "./gradlew", "getTemplatefora-checker"
}
println "Running Gradle build in $templateforCheckerDir"
injected.execOps.exec {
Expand Down
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Version 3.42.0-eisop6 (January ??, 2025)

**Closed issues:**

eisop#1003, eisop#1033.
eisop#1003, eisop#1033, eisop#1051.


Version 3.42.0-eisop5 (December 20, 2024)
Expand Down
Loading