{"id":410,"date":"2019-05-16T10:50:31","date_gmt":"2019-05-16T01:50:31","guid":{"rendered":"http:\/\/localhost:8000\/?p=410"},"modified":"2021-01-23T10:58:42","modified_gmt":"2021-01-23T01:58:42","slug":"intellij-idea-gradle-compile","status":"publish","type":"post","link":"http:\/\/localhost:8000\/2019\/05\/intellij-idea-gradle-compile.html","title":{"rendered":"IntelliJ IDEA\u3068Gradle\u30bf\u30b9\u30af\u3067\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u51fa\u529b\u5148\u304c\u7570\u306a\u308b\u554f\u984c\u306e\u5bfe\u5fdc"},"content":{"rendered":"
IntelliJ IDEA\u3068Gradle\u30bf\u30b9\u30af\u3067\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u51fa\u529b\u5148\u304c\u7570\u306a\u308b\u72b6\u614b\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u81ea\u5206\u306e\u5834\u5408\u306f\u3001\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u69cb\u7bc9\u4e2d\u306f\u4e00\u81f4\u3057\u3066\u3044\u305f\u306e\u3060\u304c\u3001\u4e00\u65e6 \u3061\u306a\u307f\u306b\u3001 IDEA\u306e \u3057\u304b\u3057\u3001\u3053\u306e\u65b9\u6cd5\u3060\u3068\u30bd\u30fc\u30b9\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u5148\u306f \u306a\u304a\u3001\u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306e\u51fa\u529b\u5148\u306fIDEA\u5834\u3067\u306f\u500b\u5225\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u305d\u3046\u3067\u3042\u308b\uff08\u5c11\u306a\u304f\u3068\u3082\u81ea\u5206\u306f\u767a\u898b\u3067\u304d\u306a\u304b\u3063\u305f\uff09\u3002<\/p>\n \u3061\u306a\u307f\u306b\u3001 \u3053\u306e\u65b9\u6cd5\u3067\u5b8c\u5168\u89e3\u6c7a\u3059\u308b\u3053\u3068\u306f\u78ba\u8a8d\u3067\u304d\u3066\u3044\u308b\u306e\u3060\u304c\u3001\u65e2\u5b58\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u308a\u8fbc\u3080\u969b\u306b\u306f\u666e\u901a\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u65b0\u898f\u4f5c\u6210\u306f\u884c\u308f\u306a\u3044\u306e\u3067\u6c17\u3065\u304d\u306b\u304f\u3044\u3002 \u304a\u305d\u3089\u304f \u3053\u306e\u8a2d\u5b9a\u3067\u8a66\u3057\u3066\u898b\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n \u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306f\u60f3\u5b9a\u901a\u308a\u3060\u304c\u3001\u3088\u304f\u898b\u308b\u3068\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u65b9\u306f\u4f59\u8a08\u306a\u968e\u5c64 \u3053\u306e\u65b9\u6cd5\u3067\u3082\u51fa\u529b\u5148\u3092\u4e00\u81f4\u3055\u305b\u308b\u3053\u3068\u306f\u3067\u304d\u305f\u3002 IntelliJ IDEA\u3068Gradle\u30bf\u30b9\u30af\u3067\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u51fa\u529b\u5148\u304c\u7570\u306a\u308b\u72b6\u614b\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u81ea\u5206\u306e\u5834\u5408\u306f\u3001\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u69cb\u7bc9\u4e2d\u306f\u4e00\u81f4\u3057\u3066\u3044\u305f\u306e\u3060\u304c\u3001\u4e00\u65e6git push\u3057\u305f\u3082\u306e\u3092\u6539\u3081\u3066git clone\u3057\u3066\u304b\u3089IDEA\u306b\u53d6\u308a\u8fbc\u3093\u3060\u969b\u306b\u7570\u306a\u308b\u72b6\u614b\u306b\u306a\u3063\u305f\u3002 IDEA\u306e\u51fa\u529b\u5148\uff1aout\/production\u306e\u914d\u4e0b\u306eclasses\u3068resources Gradle\u306e\u51fa\u529b\u5148\uff1abuild\u914d\u4e0b\u306eclasses\u3068resources \u3061\u306a\u307f\u306b\u3001classes\u306f\u30bd\u30fc\u30b9\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u5148\u3067\u3042\u308a\u3001resources\u306f\u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30d4\u30fc\u5148\u3067\u3042\u308b\u3002 \u7570\u306a\u308b\u3068\u4f55\u304c\u554f\u984c\u304b\u3068\u3044\u3046\u3068\u3001gradle\u3067\u5b9f\u884c\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u3092\u691c\u77e5\u3057\u3066AutoReload\u3057\u305f\u3044\u5834\u5408\u306b\u3001\u5909\u66f4\u3092\u691c\u77e5\u3067\u304d\u306a\u3044\u3053\u3068\u3067\u3042\u308b\u3002 \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u5909\u66f4->IDEA\u3067Build->class\u30d5\u30a1\u30a4\u30eb\u3092IDEA <\/span>Continue Reading<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[27],"tags":[],"_links":{"self":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/410"}],"collection":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/comments?post=410"}],"version-history":[{"count":1,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/410\/revisions"}],"predecessor-version":[{"id":419,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/410\/revisions\/419"}],"wp:attachment":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/media?parent=410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/categories?post=410"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/tags?post=410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}git push<\/code>\u3057\u305f\u3082\u306e\u3092\u6539\u3081\u3066
git clone<\/code>\u3057\u3066\u304b\u3089IDEA\u306b\u53d6\u308a\u8fbc\u3093\u3060\u969b\u306b\u7570\u306a\u308b\u72b6\u614b\u306b\u306a\u3063\u305f\u3002<\/p>\n
\n
out\/production<\/code>\u306e\u914d\u4e0b\u306e
classes<\/code>\u3068
resources<\/code><\/li>\n
build<\/code>\u914d\u4e0b\u306e
classes<\/code>\u3068
resources<\/code><\/li>\n<\/ul>\n
classes<\/code>\u306f\u30bd\u30fc\u30b9\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u5148\u3067\u3042\u308a\u3001
resources<\/code>\u306f\u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30d4\u30fc\u5148\u3067\u3042\u308b\u3002
\n\u7570\u306a\u308b\u3068\u4f55\u304c\u554f\u984c\u304b\u3068\u3044\u3046\u3068\u3001gradle\u3067\u5b9f\u884c\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u3092\u691c\u77e5\u3057\u3066AutoReload\u3057\u305f\u3044\u5834\u5408\u306b\u3001\u5909\u66f4\u3092\u691c\u77e5\u3067\u304d\u306a\u3044\u3053\u3068\u3067\u3042\u308b\u3002
\n\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u5909\u66f4->IDEA\u3067Build->class\u30d5\u30a1\u30a4\u30eb\u3092IDEA\u306b\u51fa\u529b\u5148\u306b\u51fa\u529b->\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306eclass path\u306fGradle\u306e\u51fa\u529b\u5148\u306a\u306e\u3067\u5909\u66f4\u3092\u691c\u77e5\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u6d41\u308c\u3067\u3042\u308b\u3002
\n\u3053\u306e\u554f\u984c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306b\u3001IDEA\u3068Gradle\u306e\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u51fa\u529b\u5148\u3092\u4e00\u81f4\u3055\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n\u65b9\u6cd5\uff11\uff1aIDEA\u306e\u8a2d\u5b9a\u3067\u51fa\u529b\u5148\u3092\u5909\u66f4\u3059\u308b\uff08\u90e8\u5206\u7684\u306b\u3057\u304b\u89e3\u6c7a\u3057\u306a\u3044\uff09<\/h2>\n
Project Structure<\/code> ->
Modules<\/code> ->
Paths<\/code> ->
Compiler output<\/code>\u3067\u3001
Use module compile output path<\/code>\u3092\u9078\u629e\u3057\u3001Output path\u3092Gradle\u306e\u51fa\u529b\u5148\u3068\u5408\u308f\u305b\u308b\u3002
\n<\/p>\nbuild\/classes<\/code>\u306b\u306a\u308aGradle\u3068\u4e00\u81f4\u3055\u305b\u3089\u308c\u308b\u306e\u3060\u304c\u3001\u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306e\u51fa\u529b\u5148\u306f
out\/production<\/code>\u306e\u307e\u307e\u306a\u306e\u3067\u7570\u306a\u3063\u305f\u307e\u307e\u3067\u3042\u308b\u3002\u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306fAutoReload\u5bfe\u8c61\u306b\u3057\u306a\u304f\u3066\u3082\u3044\u3044\u3068\u3044\u3046\u4eba\u306f\u3053\u306e\u65b9\u6cd5\u3067\u5341\u5206\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n
Project Structure<\/code> ->
Project<\/code> ->
Project compiler output<\/code>\u3092
\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d1\u30b9\/build<\/code>\u306b\u5909\u66f4\u3057\u3066\u3001
Module<\/code> ->
Paths<\/code> ->
Compiler output<\/code>\u3092
Inherit project compile output path<\/code>\u306b\u3059\u308b\u3053\u3068\u3067\u3046\u307e\u304f\u3044\u304d\u305d\u3046\u306a\u3082\u306e\u3060\u304c\u3001\u6b8b\u5ff5\u306a\u3053\u3068\u306bIDEA\u304c
build\/production\/<\/code>\u306e\u3088\u3046\u306b\u52dd\u624b\u306b
production<\/code>\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3001Gardle\u306e\u51fa\u529b\u5148\u3068\u4e00\u81f4\u3055\u305b\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u3002<\/p>\n
\u65b9\u6cd5\uff12\uff1aIDEA\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210\u6642\u306bGradle\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u4f5c\u6210\u3059\u308b\uff08\u89e3\u6c7a\u3059\u308b\uff09<\/h2>\n
\n\u3053\u3053\u3067\u306fgit clone<\/code>\u3057\u305f\u65e2\u5b58\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u65b0\u898f\u4f5c\u6210\u6271\u3044\u3067\u53d6\u308a\u8fbc\u3080\u624b\u9806\u3092\u8a18\u8f09\u3059\u308b\u3002<\/p>\n
\n
git clone<\/code>\u3059\u308b<\/li>\n
Create New Project<\/code>\u3092\u9078\u629e\u3059\u308b\u3002
\nImport Project<\/code>\u3084
Open<\/code>\u306f\u4f7f\u308f\u306a\u3044
\n<\/li>\n
\n<\/li>\nGroupId<\/code>\u3068
ArtifactId<\/code>\u306b\u9069\u5f53\u306a\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u3002
\nGroupId<\/code>\u306f\u9069\u5f53\u306a\u5024\u3067OK\u3002
ArtifactId<\/code>\u306f\u65e2\u5b58\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u540d\u79f0\u3068\u4e00\u81f4\u3055\u305b\u308b\u3002
\n<\/li>\n
\nUser auto-import<\/code>\u306f
build.gradle<\/code>\u306b\u5909\u66f4\u304c\u3042\u3063\u305f\u3089\u81ea\u52d5\u3067\u4f9d\u5b58\u95a2\u4fc2\u306a\u3069\u3092\u89e3\u6c7a\u3057\u3066\u304f\u308c\u308b\u3068\u3044\u3046\u3084\u3064\u306a\u306e\u3067\u3001\u597d\u307f\u3067\u5916\u3057\u3066\u3082\u3044\u3044\u3068\u601d\u3046\u3002
\nCreate separate module per source set<\/code>\u306f
main<\/code>\u3068
test<\/code>\u3092\u5225\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u3057\u3066\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u308b\u3068\u3044\u3046\u3082\u306e\u306a\u306e\u3067\u3001\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304a\u3044\u305f\u65b9\u304c\u826f\u3044\u3068\u601d\u3046\u3002
\nUse default gradle wrapper<\/code>\u3082\u63a8\u5968\u306a\u306e\u3067\u8a2d\u5b9a\u3057\u3066\u304a\u3044\u305f\u65b9\u304c\u826f\u3044\u3068\u601d\u308f\u308c\u308b\u3002
\n<\/li>\ngit clone<\/code>\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u3068\u4e00\u81f4\u3059\u308b\u3088\u3046\u306b
Project name<\/code>\u3068
Project location<\/code>\u3092\u8a2d\u5b9a\u3059\u308b
\n<\/li>\ngit diff<\/code>\u3067\u78ba\u8a8d\u3059\u308b
\n\u77e2\u5370\u306e\u90e8\u5206\u304c\u52dd\u624b\u306b\u4f5c\u6210\u3055\u308c\u305f\u90e8\u5206\u306a\u306e\u3067\u3001\u3053\u306e\u90e8\u5206\u3092\u524a\u9664\u3059\u308b\u3002
\n\u3061\u306a\u307f\u306b\u3001\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f.gitignore<\/code>\u306b
.idea<\/code>\u3068
.gradle<\/code>\u3092\u8a2d\u5b9a\u6e08\u307f\u306a\u306e\u3067\u305d\u3053\u306f\u5dee\u5206\u3068\u3057\u3066\u51fa\u3066\u3044\u306a\u3044\u3002\u3082\u3057\u8a2d\u5b9a\u3057\u3066\u306a\u304b\u3063\u305f\u3089\u8a2d\u5b9a\u3057\u305f\u65b9\u304c\u826f\u3044\u3002
\n<\/li>\n
\ngit reset --hard master<\/code>\u3067\u4e00\u767a\u3067\u3084\u3063\u3066\u3082\u3044\u3044\u3057\u3001\u4e00\u3064\u4e00\u3064\u5909\u66f4\u3092\u7834\u68c4\u3057\u3066\u3082\u3044\u3044\u3068\u601d\u3046\u3002<\/li>\n
\n<\/li>\n<\/ol>\n\u65b9\u6cd5\uff13\uff1aGradle\u306e\u8a2d\u5b9a\u3067\u51fa\u529b\u5148\u3092\u5909\u66f4\u3059\u308b\uff08\u89e3\u6c7a\u3059\u308b\uff09<\/h2>\n
build.gradle<\/code>\u3067Gradle\u30bf\u30b9\u30af\u306e\u30b3\u30f3\u30d1\u30a4\u30e9\u51fa\u529b\u5148\u3092
out\/production<\/code>\u306b\u5909\u66f4\u3059\u308b\u3068\u3044\u3046\u306e\u3082\u3001\u3082\u3046\u4e00\u3064\u306e\u89e3\u653e\u306b\u306a\u308a\u3048\u308b\u3068\u601d\u3046\u3002 <\/p>\n
compileJava {\n buildDir = "out\/production"\n}\ncompileKotlin {\n buildDir = "out\/production"\n}\nsourceSets {\n main {\n output.resourcesDir = "out\/production\/resources"\n }\n}<\/code><\/pre>\n
\n
out\/production\/classes\/kotlin\/main\/sample<\/code><\/li>\n
out\/production\/resources<\/code><\/li>\n<\/ul>\n
kotlin\/main<\/code>\u304c\u3067\u304d\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3002
\n\u3053\u308c\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b\u3001IDEA\u306eProject Structure<\/code> ->
Modules<\/code> ->
Paths<\/code> ->
Compiler output<\/code>\u3067\u3001
Use module compile output path<\/code>\u3092\u9078\u629e\u3057\u3001
Output path<\/code>\u306b
\n\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30eb\u30fc\u30c8\/out\/production\/classes\/kotlin\/main<\/code>\u3092\u8a2d\u5b9a\u3057\u3001Gradle\u306e\u51fa\u529b\u5148\u3068\u5408\u308f\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n
\n\u3057\u304b\u3057\u3001build.gradle<\/code>\u3068IDEA\u306e\u4e8c\u3064\u306e\u8a2d\u5b9a\u304c\u5fc5\u8981\u306b\u306a\u308b\u306e\u3067\u3001\u65b9\u6cd5\uff12\u306e\u65b9\u304c\u307e\u3060\u30de\u30b7\u306a\u6c17\u304c\u3059\u308b\u306e\u3067\u3001\u79c1\u81ea\u8eab\u306f\u65b9\u6cd5\uff12\u3092\u63a1\u7528\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"