Comments (5)
Added in 1.1.11.
from gradle-pitest-plugin.
I was unable to make it work out of the box for #276 (i.e. running gradle build on windows machine while having a really long dependency list). Since taskClasspath is still automatically constructed from runtime classpaths of testSourceSets the resulting classpath might still be too long for windows machine even if you are using classPathFile.
My WA was to set classPathFile AND provide a fake testSourceSets while still adding all corresponding dependencies into class path file + adding required task dependencies.
Note that you can't just erase testSourceSet because plugin will still generate an empty classpath argument for a command line runner which in turn results in Pitest's OptionParser to omit mutableCodePaths, which comes next.
Working WA code:
task pitestClassPathFile(dependsOn: testClasses) << {
StringBuilder classPathFileContents = new StringBuilder()
sourceSets.test.runtimeClasspath.getFiles().forEach { filePath ->
classPathFileContents.append(filePath).append('\n')
}
def classPathFile = new File("${project.buildDir}/pitestClassPathFile")
classPathFile.write(classPathFileContents.toString())
}
pitest {
...
def fakeSourceSet = [
runtimeClasspath: project.sourceSets.test.output.classesDir,
name: project.sourceSets.test.name
]
testSourceSets = [ fakeSourceSet ]
classPathFile = file("${project.buildDir}/pitestClassPathFile")
}
tasks['pitest'].dependsOn pitestClassPathFile
from gradle-pitest-plugin.
Probably the quickest fix would be to just omit classPath command line argument if it's empty and/or if classPathFile is provided.
from gradle-pitest-plugin.
I was thinking about a similar solution. An additional useClassPathFile
boolean property to make the plugin use an automatically created file filled with a classPath and to clear up the classPath
parameter passed to PIT.
from gradle-pitest-plugin.
The Gradle plugin itself doesn't provide a direct way to specify a classpath
passed to PIT - it is based on the project configuration. It was my oversight to expose classPathFile
directly in the plugin configuration. Created #56.
Thanks @FlasH-RUS for spotting the issue.
from gradle-pitest-plugin.
Related Issues (20)
- Gradle 8.1-rc-* and configuration cache has issues with plugin HOT 7
- junit5PluginVersion = '1.1.2' can the compatiable verstion be picked up from test configuration HOT 5
- Plugin execution on windows fails with CreateProcess error 206 HOT 4
- how to include testng, cucubmer and junit 3 to 5 tests to be mutated HOT 1
- Auto add junit-platform-launcher to classpath HOT 13
- info.solidsoft.pitest fails to respect toolchain configured JVM HOT 2
- Add examples of using plugin with kotlin-dsl HOT 3
- PITest suddenly breaks HOT 4
- `input`- / `outputCharset` are unusable because they are not serializable
- convention usage must be removed HOT 7
- PitestAggregator doesn't pick up all reports in a multi module project HOT 10
- Ability to override verbose from command line
- Remove history locations from inputs/outputs HOT 2
- Compatibility with JUnit 5.10.0 is broken HOT 4
- Release with CD failed with "Support for password authentication was removed" although PAT is used
- Unsupported class file major version Error? HOT 7
- idea throws exception when importing a project that uses the plugin HOT 3
- How to make sure this plugin also runs testng HOT 7
- Starting pitest fails with exception "The file name or extension is too long" HOT 1
- Task 'pitest' not found in root project (Running pitest with Gradle 8.7) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-pitest-plugin.