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

Now using ant task #2

Open
ylemoigne opened this issue Jul 13, 2013 · 0 comments
Open

Now using ant task #2

ylemoigne opened this issue Jul 13, 2013 · 0 comments

Comments

@ylemoigne
Copy link

If someone looking here, sample using the xtend ant task (available since xtend 2.4.2)

configurations {
    xtendc
}

dependencies {
    compile 'org.eclipse.xtend:org.eclipse.xtend.lib:2.4.2'
    compile 'org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.4.2'

    xtendc 'org.eclipse.xtend:org.eclipse.xtend.standalone:2.4.2'
}

task compileXtend << {
    ant.taskdef(name: 'xtendc', classname: 'org.eclipse.xtend.core.compiler.batch.XtendCompilerAntTask', classpath: configurations.xtendc.asPath)
    ant.xtendc(destdir: 'src/main/generated-sources') {
        srcdir {
            sourceSets.main.java.srcDirs.findAll { it.exists() }.each {
                pathelement(path: it)
            }
        }
        classpath {
            pathelement(path: configurations.xtendc.asPath)
            sourceSets.main.compileClasspath.each {
                pathelement(location: it)
            }
        }
    }
}

tasks.compileJava.dependsOn compileXtend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant