質問編集履歴
3
対処法の追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -177,3 +177,63 @@
|
|
177
177
|
|
178
178
|
|
179
179
|
今回出てくる`./target`ディレクトリは、`sbt run`した後に自動生成される、`my-sbt-project/target`でも`my-sbt-project/project/target`のことではありません。
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
# (追記)対処法
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
[@rysh](https://teratail.com/users/rysh) さんに対処法を回答したいただいたので、ここで紹介します。
|
192
|
+
|
193
|
+
(実際の回答ではなくコメントなので、目につきにくいと思うので、同じく困ってる人が来たとき、わかりやすくしたいと思って書きました)
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
以下の支持に従うとうまくいきます。
|
198
|
+
|
199
|
+
[https://github.com/sbt/sbt/issues/2835](https://github.com/sbt/sbt/issues/2835)
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
具体的には、
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
`~/.sbt/0.13/target-relocate.sbt`というファイルを以下の内容で保存すればOKです(ぼくの場合はもともとなかったので、新規ファイル作成しました)。
|
208
|
+
|
209
|
+
([@djspiewak](https://github.com/djspiewak) さんのコメントの内容から引用しています)
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
```scala
|
214
|
+
|
215
|
+
import java.io.File
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
target := {
|
220
|
+
|
221
|
+
val buildSbt = baseDirectory.value / "build.sbt"
|
222
|
+
|
223
|
+
val projectSbt = baseDirectory.value / "project.sbt"
|
224
|
+
|
225
|
+
val project = baseDirectory.value / "project"
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
if (buildSbt.exists() || projectSbt.exists() || project.exists())
|
230
|
+
|
231
|
+
target.value
|
232
|
+
|
233
|
+
else
|
234
|
+
|
235
|
+
new File("/tmp") / "sbt" / sbtVersion.value / "target"
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
```
|
2
誤字修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,7 +64,7 @@
|
|
64
64
|
|
65
65
|
|
66
66
|
|
67
|
-
# 自分がやった
|
67
|
+
# 自分がやった手順(コマンドバージョン)
|
68
68
|
|
69
69
|
|
70
70
|
|
1
ディレクトリ階層の情報量を増やした
test
CHANGED
File without changes
|
test
CHANGED
@@ -100,41 +100,65 @@
|
|
100
100
|
|
101
101
|
my-sbt-project target
|
102
102
|
|
103
|
-
#
|
103
|
+
# カレントの階層をtreeで見てみる(treeはbrew install treeです)
|
104
104
|
|
105
|
-
$ tree
|
105
|
+
$ tree .
|
106
106
|
|
107
|
-
|
107
|
+
.
|
108
108
|
|
109
|
-
├──
|
109
|
+
├── my-sbt-project
|
110
110
|
|
111
|
-
├──
|
111
|
+
│ ├── build.sbt
|
112
112
|
|
113
|
-
│ ├──
|
113
|
+
│ ├── project
|
114
114
|
|
115
|
-
│
|
115
|
+
│ │ ├── Dependencies.scala
|
116
116
|
|
117
|
-
└── s
|
117
|
+
│ │ └── build.properties
|
118
118
|
|
119
|
-
|
119
|
+
│ └── src
|
120
120
|
|
121
|
-
|
121
|
+
│ ├── main
|
122
122
|
|
123
|
-
│
|
123
|
+
│ │ └── scala
|
124
124
|
|
125
|
-
│
|
125
|
+
│ │ └── example
|
126
126
|
|
127
|
-
└──
|
127
|
+
│ │ └── Hello.scala
|
128
128
|
|
129
|
-
|
129
|
+
│ └── test
|
130
130
|
|
131
|
-
|
131
|
+
│ └── scala
|
132
132
|
|
133
|
+
│ └── example
|
134
|
+
|
133
|
-
└── HelloSpec.scala
|
135
|
+
│ └── HelloSpec.scala
|
136
|
+
|
137
|
+
└── target
|
138
|
+
|
139
|
+
└── streams
|
140
|
+
|
141
|
+
└── $global
|
142
|
+
|
143
|
+
├── ivyConfiguration
|
144
|
+
|
145
|
+
│ └── $global
|
146
|
+
|
147
|
+
│ └── streams
|
148
|
+
|
149
|
+
│ └── out
|
150
|
+
|
151
|
+
└── projectDescriptors
|
152
|
+
|
153
|
+
└── $global
|
154
|
+
|
155
|
+
└── streams
|
156
|
+
|
157
|
+
└── out
|
134
158
|
|
135
159
|
|
136
160
|
|
137
|
-
8 directories,
|
161
|
+
18 directories, 7 files
|
138
162
|
|
139
163
|
```
|
140
164
|
|
@@ -144,7 +168,7 @@
|
|
144
168
|
|
145
169
|
|
146
170
|
|
147
|
-
これが、通常のsbtの挙動なんですか?もしそうなら、`./target`ディレクトリはなんですか?
|
171
|
+
これが、通常のsbtの挙動なんですか?もしそうなら、`./target`ディレクトリはなんのために必要ですか?
|
148
172
|
|
149
173
|
|
150
174
|
|