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

Clear The Screen in Continuous Runs #164

Open
gregorriegler opened this issue Sep 18, 2020 · 1 comment
Open

Clear The Screen in Continuous Runs #164

gregorriegler opened this issue Sep 18, 2020 · 1 comment
Assignees
Labels

Comments

@gregorriegler
Copy link

When you run your tests in continuous mode,
./gradlew test -t
the plugin should clear the commandline screen before printing the next test report, just like mocha does.
so your result always starts nicely at the top.
would like to use this when doing tdd.

Here is a similar issue:
https://discuss.gradle.org/t/possibility-to-clear-screen-before-continous-build-output/24488

@gregorriegler
Copy link
Author

This is how they did it in the tdd-gradle-plugin

class ContinuousClearPlugin implements Plugin<Project> {

	@Override
	public void apply(Project project) {
		if (project.gradle.startParameter.continuous) {
			project.gradle.addListener( new BuildAdapter() {
				void projectsEvaluated(Gradle gradle) {
					if (System.getProperty("os.name").startsWith("Windows")) {
						project.exec { commandLine 'cls' }
					}
					else {
						project.exec { commandLine 'clear' }
					}
				}
			});
		}
	}
}

https://github.com/38leinaD/tdd-gradle-plugin/blob/master/src/main/groovy/de/dplatz/gradle/tdd/ContinuousClearPlugin.groovy

@radarsh radarsh added this to the 3.0.0 milestone Oct 14, 2020
@radarsh radarsh modified the milestones: 3.0.0, 3.1.0 Mar 25, 2021
@radarsh radarsh modified the milestones: 3.1.0, 3.2.0 Nov 2, 2021
@radarsh radarsh removed this from the 3.2.0 milestone Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants