2017-07-04 49 views
0

我正在尝试将angular-cli的种子项目与我的由Gradle打包并部署在tomcat服务器中的java应用程序集成。将角度cli项目与groovy gradle应用程序集成

如何将角度构建与Gradle构建相结合?哪里最好把我的项目编译的scss文件。我正在考虑将它们置于资产之下,并且编译后的css文件也将在资产下生成。

这里是我的文件夹结构:

myApp 
├── gradle 
├── src 
│ └── main 
│  ├── groovy 
│  ├── resources 
│  ├── webapp 
│  └── ngapp 
      ├── angular-cli.json 
      ├── e2e 
      ├── karma.conf.js 
      ├── node_modules 
      ├── package.json 
      ├── protractor.conf.js 
      ├── tslint.json 
      ├── tsconfig.json 
      ├── WEB-INF 
      ├── src 
       ├── app //app component and other features components here 
       ├── assets 
       ├── environments 
       ├── typings.d.ts 
       ├── index.html 
       ├── main.ts 
       ├── polyfills.ts 
       ├── styles.css 
       └── tsconfig.app.json 

.angular-cli.json

{ 
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 
    "project": { 
    "name": "ngapp" 
    }, 
    "apps": [ 
    { 
     "root": "src", 
     "outDir": "../webapp/ng", 
     "assets": [ 
     "assets" 
     ], 
     "index": "index.html", 
     "main": "main.ts", 
     "polyfills": "polyfills.ts", 
     "tsconfig": "tsconfig.json", 
     "styles": [ 
     "styles.css" 
     ], 
     "scripts": [], 
     "environmentSource": "environments/environment.ts", 
     "environments": { 
     "dev": "environments/environment.ts", 
     "prod": "environments/environment.prod.ts" 
     } 
    } 
    ], 
    "e2e": { 
    "protractor": { 
     "config": "./protractor.conf.js" 
    } 
    }, 
    "lint": [ 
    { 
     "project": "src/main/ngapp/tsconfig.json" 
    } 
    ], 
    "defaults": { 
    "styleExt": "css", 
    "component": {} 
    } 
} 

tsconfig.json:

{ 
     "compileOnSave": false, 
     "compilerOptions": { 
     "outDir": "./dist/out-tsc", 
     "baseUrl": "src/main/ngapp", 
     "sourceMap": true, 
     "declaration": false, 
     "moduleResolution": "node", 
     "emitDecoratorMetadata": true, 
     "experimentalDecorators": true, 
     "target": "es5", 
     "typeRoots": [ 
      "node_modules/@types" 
     ], 
     "lib": [ 
      "es2016", 
      "dom" 
     ] 
     } 
} 

回答

0

也许与

问题
"lint": [{ 
    "project": "src/main/ngapp/tsconfig.json" 
}] 

通常它看起来像

"lint": [{ 
    "project": "src/tsconfig.json" 
}] 
+0

我通过在我的src/main /再次再生该项目解决了这个问题。仍然在与Gradle构建整合。 – Hazu