Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Simple gradle xtext generator example?
Simple gradle xtext generator example? [message #1733522] Sun, 29 May 2016 16:45
Ian Warwick is currently offline Ian WarwickFriend
Messages: 44
Registered: April 2012
Member
Hey guys I am trying to make a simple gradle plugin by following the guide http://xtext.github.io/xtext-gradle-plugin/xtext-builder.html but I think the simple example does not execute the generator associated with my simple language.

I did look at the other examples (xtend plugin, android plugin) but I still can't figure it out.

This is what I have so far and I believe this is due to my complete lack of knowledge of the gradle api and the xtext gradle plugins.

package org.specapi.gradle

import org.gradle.api.*
import org.xtext.gradle.*
import org.xtext.gradle.tasks.*

class SpecApiPlugin implements Plugin<Project> {
    override apply(Project project) {
        project.apply[plugin(XtextBuilderPlugin)]
        val xtext = project.extensions.getByType(XtextExtension)
        val specapi = xtext.languages.maybeCreate("specapi") => [
            setup = "org.specapi.SpecApiLangStandaloneSetup"
            fileExtension = "specapi"
        ]
    }
}


So the question is how do I execute my generator the simple way? Smile

Cheers,

Ian
Previous Topic:How to combine to different plugins
Next Topic:Do we have a way to get the affected resource by any change in any file?
Goto Forum:
  


Current Time: Thu Apr 25 15:35:04 GMT 2024

Powered by FUDForum. Page generated in 0.03058 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top