0

我正在开发一个 Web 应用程序,使用Grails 2.2.3with Ember.js (rc3)。我使用IntelliJ IDEA 12.1Utlimate 作为 IDE 和IntelliJ TeamCityCI 服务器 - 一切都在Windows 7 Professional SP1. 现在我想用它Gradle 1.7来更好地组织我的构建任务(组合Grails、、Grunt测试等等……),我期待天堂,但我得到的只是地狱……

当我开始使用该gradle.build文件并JetGradle在 IntelliJ IDEA 中启动时,它开始一遍又一遍地扫描和索引文件(实际上它现在仍在运行 - 14 小时并且还在计数),IDE 被阻塞,我什么也做不了。 ..这真的令人沮丧。

如果有任何兴趣,这是我的gradle.build

import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.tasks.Exec
import org.grails.gradle.plugin.GrailsTask

buildscript {
  repositories {
    maven { url "http://my.company.archiva:8080/repository/internal" }
    maven { url "http://repo.grails.org/grails/repo" }
  }

  dependencies {
    classpath "org.grails:grails-gradle-plugin:2.0.0-SNAPSHOT",
        "org.grails:grails-bootstrap:2.2.3"
  }
}

apply plugin: "grails"
apply plugin: "base"

repositories {
  maven { url "http://my.company.archiva:8080/repository/internal" }
  maven { url "http://repo.grails.org/grails/repo" }
}

grails {
  grailsVersion "2.2.3"
}

configurations {
  all {
    exclude module: "commons-logging"
    exclude module: "xml-apis"
    exclude module: "grails-plugin-log4j"
    exclude module: "slf4j-log4j12"
  }
  test {
    exclude module: "groovy-all"
  }
  compile {
    exclude module: "hibernate"
  }
  compileOnly
}

dependencies {
  compile("com.my.company:grails-custom-plugin1:0.1.7@zip")
  compile("com.my.company:grails-cusotm-plugin:0.2@zip")
  compile("com.my.company:backendapi:1.1")

  compile("org.mozilla:rhino:1.7R4")

  compile("io.netty:netty:3.3.1.Final")
  compile("com.google.protobuf:protobuf-java:2.4.1")

  compile("org.grails.plugins:cache:1.0.1")

  compileOnly "org.grails:grails-plugin-tomcat:$grails.grailsVersion" // No tomcat-*.jar in the war

  bootstrap "org.codehaus.groovy:groovy-all:2.0.5"
}


/*
GRADLE Wrapper
*/

task wrapper(type: Wrapper) {
  gradleVersion = '1.7'
}


/*
GRUNT Section
*/

task npm(type: Exec) {
  group = "Build"
  description = "Installs all Node.js dependencies defined in package.json"
  workingDir "web-app"
  commandLine = ["npm.cmd", "install"]
  inputs.file "package.json"
  outputs.dir "node_modules"
}

task production(type: GruntTask) {
  gruntArgs = "prod"
}

class GruntTask extends Exec {
  private String gruntExecutable = Os.isFamily(Os.FAMILY_WINDOWS) ? "grunt.cmd" : "grunt"
  private String switches = "--no-color"
  private String workDir = "web-app"

  String gruntArgs = ""

  public GruntTask() {
    super()
    this.setExecutable(gruntExecutable)
    this.workingDir(workDir)
  }

  public void setGruntArgs(String gruntArgs) {
    this.args = "$switches $gruntArgs".trim().split(" ") as List
  }
}

/*
WAR creation
*/

task war(type: GrailsTask) {
  command "war"
  env "prod"
}

有没有人可以帮助我?我在互联网上上下搜索,但似乎没有人使用 , , 的组合,或者Grails一切都很简单,我只是愚蠢地使用这些工具......Ember.jsGradleIntelliJ IDEA

4

1 回答 1

1

我不建议在 IDEA 12 中使用 Gradle 集成,因为它太有限了。(IDEA 13 会更好。)相反,您可以使用 Gradle 的“idea”插件来生成 IDEA 文件。不确定所有这些与 Grails 一起工作的效果如何。Grails 自己的构建工具与 Grails 的其余部分深度集成,据我所知,使用其他任何东西都意味着做出妥协。(虽然我没有第一手经验。)Grails 计划有一天将其内置构建工具切换到 Gradle。

PS:如果没有,我会搜索 IDEA 问题跟踪器并提交问题。

于 2013-08-16T08:21:54.100 回答