I am writing a Gradle Plugin Test I'm writing (first plugin ever for me).

one of the methods looks like (notice the hard-coded path):

@Test
    public void testLoadExportTemplate() {
        //TODO make this relational to the project
        LocalizationPluginConvention pluginConvention =
project.convention.plugins["config"]
        String command =
plugin.buildBatchCommand("/Users/phil/dev/sag/bas_core/trunk/modules/plugins-localization/src/main/groovy/com/sag/bas/plugins/export.template",
pluginConvention)

        String expectedBatchCommand = <A bunch of XML>
        String expectedXmlAsText = new
XmlSlurper().parseText(expectedBatchCommand).text()
        String actualXmlAsText = new XmlSlurper().parseText(command).text()
        assert expectedXmlAsText == actualXmlAsText : "batch commands
don't match"
        println "wows!"
    }


My question is how do I get rid of the hard-coded path
"/Users/phil/dev/sag/bas_core/trunk/modules/plugins-localization/src/main/groovy/com/sag/bas/plugins/export.template"?
 It is stored in my gradle src tree....  Note I want it to work from
gradle AND from my IDE.

Thanks for any thoughts.  Also, feel free to suggest improvements on
approach above.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to