2013-08-16 41 views
0

我正在開發一個web應用程序,使用Grails 2.2.3Ember.js (rc3)。我使用IntelliJ IDEA 12.1 Utlimate作爲IDE以及IntelliJ TeamCity CI服務器 - 所有內容均在Windows 7 Professional SP1之間。現在我想用Gradle 1.7更好地組織我的構建任務(合併GrailsGrunt,檢測等...),我預計天堂但我得到的是地獄 ...IntelliJ IDEA:Gradle索引文件 - 無限循環

只要我開始在IntelliJ IDEA中使用gradle.build文件並啓動JetGradle,它開始反覆掃描和索引文件(實際上它現在仍在運行--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:[email protected]") 
    compile("com.my.company:grails-cusotm-plugin:[email protected]") 
    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" 
} 

是沒有人在那裏誰是能幫助我嗎?我在網上搜索上下,但似乎要麼無人使用的GrailsEmber.jsGradleIntelliJ IDEA組合或一切是死的簡單,我只是愚蠢使用的工具...

回答

1

我不建議在IDEA 12中使用Gradle集成,因爲它太有限了。 (IDEA 13會更好。)相反,您可以使用Gradle的「idea」插件來生成IDEA文件。不確定所有這些與Grails一起工作的效果如何。 Grails自己的構建工具與其他Grails深度集成,從我聽說的,使用任何其他方式意味着妥協。 (儘管我沒有第一手經驗)。有一天,計劃讓Grails將其內置的構建工具轉換到Gradle。

PS:我會搜索IDEA問題跟蹤器,並提出問題,如果沒有。

+0

非常感謝!我將在IntelliJ上搜索問題跟蹤器,看看我是否找到有用的東西/如果沒有,發佈錯誤。似乎我不得不重新考慮整個Gradle事情(不幸的是)給我更多的麻煩,還有Grails的魔法...... – herom