我有一个gradle项目(后端),我想添加基于Vaadin的前端。但是我没有找到任何针对Vaadin的gradle插件。
正如前面已经提到的,Vaadin应用程序是一个简单的Web应用程序,不需要任何额外的插件,只需使用“java”和“war”(可能需要“jetty”来运行应用程序)。目前似乎有第一个专门针对Vaadin的Gradle插件可用:
https://github.com/johndevs/gradle-vaadin-plugin
它将帮助您完成Vaadin特定的任务,例如构建widget集,创建组件框架等。
https://github.com/bmuschko/gradle-tomcat-plugin
如果您需要创建自定义小部件并将它们编译到一个GWT编译的小部件集中。https://vaadin.com/book/vaadin6/-/page/gwt.development.html#gwt.development.compiler
注意:Vaadin7书籍不再包含开发Gwt小部件的章节。就 Vaadin 和 Gradle 架构而言,看起来非常全面。我还包括了 我在旅途中发现的另一个基于 Vaadin 的 'build.gradle' 链接,使用了 Google 非常有用的 'filetype' 搜索(还请查看相关的 gradle.properties 文件)。
JFYI,Google 文件搜索是:
filetype:<extension> <your search phrases>
//Template plugin - Great for project-layout setup - See http://tellurianring.com/wiki/gradle/templates
apply from: 'http://launchpad.net/gradle-templates/trunk/latest/+download/apply.groovy'
apply plugin: 'eclipse'
apply plugin: 'idea'
// if you want to distribute the gradle with your code
task('wrapper', type: Wrapper).configure {
gradleVersion = '1.0-milestone-8a'
}
def versionCompatibility = 1.6
//configurations.providedDependencies.extendsFrom configurations.gwt
eclipse {
project {
comment = ""
buildCommand "org.eclipse.jdt.core.javabuilder"
buildCommand "org.eclipse.wst.jsdt.core.javascriptValidator"
buildCommand "org.eclipse.wst.common.project.facet.core.builder"
buildCommand "org.eclipse.wst.validation.validationbuilder"
buildCommand "com.vaadin.integration.eclipse.widgetsetBuilder"
//buildCommand "org.eclipse.m2e.core.maven2Builder"
//buildCommand "org.maven.ide.eclipse.maven2Builder"
//buildCommand "com.google.gdt.eclipse.core.webAppProjectValidator"
//buildCommand "com.google.gwt.eclipse.core.gwtProjectValidator"
//buildCommand "com.google.gdt.eclipse.designer.GWTBuilder"
//Don't forget commas - no trailing
natures "org.eclipse.jdt.core.javanature",
"com.vaadin.integration.eclipse.widgetsetNature",
"org.eclipse.wst.jsdt.core.jsNature",
"org.eclipse.wst.common.project.facet.core.nature",
"org.eclipse.wst.common.modulecore.ModuleCoreNature",
"org.eclipse.jem.workbench.JavaEMFNature"
//"org.eclipse.m2e.core.maven2Nature",
//"org.maven.ide.eclipse.maven2Nature",
//"com.google.gwt.eclipse.core.gwtNature"
//"com.google.gdt.eclipse.designer.GWTNature",
//"ch.epfl.lamp.sdt.core.scalanature",
//"com.springsource.sts.grails.core.nature",
//"org.eclipse.jdt.groovy.core.groovyNature"
}
classpath {
containers "com.google.gwt.eclipse.core.GWT_CONTAINER"
//"com.springsource.sts.gradle.classpathcontainer"
//minusConfigurations=[configurations.gwt]
}
}
idea {
project {
jdkName = versionCompatibility
ipr {
withXml { provider ->
def node = provider.asNode()
// Set Gradle home
def gradleSettings = node.appendNode('component', [name: 'GradleSettings'])
gradleSettings.appendNode('option', [name: 'SDK_HOME', value: gradle.gradleHomeDir])
}
}
}
}