Play! 2.0 with와 나는 build system에 관한 질문을 가지고있다. 여러 프로젝트가 합쳐져 있고 정적 파일과 CSS가 컴파일 된 일부 파일이 포함 된 공유 모듈이 있습니다.다중 프로젝트 빌드에서 SBT로 설정 재사용
컴파일 된 스타일 시트의 출력을 다른 프로젝트에 복사하는 방법은 무엇입니까? 나는 혼자서 이해하려했지만 프로젝트에 설정을 쉽게 적용 할 수 있지만 다른 프로젝트에서 그 설정을 검색 할 수는 없다.
나는 놀이를 들여다 보았다! 2.0 키
val playAssetsDirectories = SettingKey[Seq[File]]("play-assets-directories")
val incrementalAssetsCompilation = SettingKey[Boolean]("play-incremental-assets-compilation")
val playExternalAssets = SettingKey[Seq[(File, File => PathFinder, String)]]("play-external-assets")
그러나이 정보를 사용하여 빌드 파일을 수정하는 방법에 대해서는 잘 모릅니다.
website.playExternalAssets += common.playAssetsDirectory(IncludingCompiled)
을하지만, 이것은 분명히 불법입니다 : 기본적으로 내가 원하는 무엇
object ApplicationBuild extends Build {
val appName = "Website"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
)
val common = PlayProject(
appName + "-common", appVersion, path = file("modules/common"),mainLang=SCALA,
lessEntryPoints <<= baseDirectory(_/"app"/"assets"/"stylesheets" ** "bootstrap.less")
)
val website = PlayProject(
appName + "-website", appVersion, path = file("modules/website"),mainLang=SCALA,
).dependsOn(common)
val adminArea = PlayProject(
appName + "-admin", appVersion, path = file("modules/admin"),mainLang=SCALA,
).dependsOn(common)
val main = PlayProject(
appName, appVersion,appDependencies,mainLang=SCALA
).dependsOn(
website, adminArea
)
}
는 말할 수 있습니다.
는 사실은 조금 더 이해하고, 다음 코드는 거의 바로 보인다 작동하지 않는 common.playAssetsDirectory를 제외하고val website = PlayProject(
appName + "-website", appVersion, path = file("modules/website"),mainLang=SCALA
).dependsOn(common).settings(playExternalAssets <<= common.playAssetsDirectory(IncludingCompile))
: 그것은 여기 문제처럼 보인다
[info] Loading project definition from G:\project1\project [error] G:\project1\project\Build.scala:26: value playAssetsDirectory is not a member of sbt.Project [error] ).dependsOn(common).settings(playExternalAssets <<= common.playA ssetsDirectory(IncludingCompile)) [error] ^[error] one error found [error] {file:/G:/project1/project/}default-436781/compile:compile: Compilati on failed
그 열쇠는 일정한 가치이며 프로젝트의 속성이 아닙니다. 사실, 키는 PlayKeys에서 정의 된 일정한 전역 값이므로 실제로 범위를 지정해야하지만 방법을 모르겠습니다.
아, 이제 나는 당신이하려는 것을 이해합니다! –
코드로 붙여 넣는 대신 오류 메시지를 인용했습니다. 그것은'^'카레의 위치를 파괴했다. 추측에 따라 '공통점'을 제거하십시오. –
내가 설명한대로 키가 범위를 지정해야하기 때문에 작동하지 않습니다. : – Edmondo1984