FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
frontend/project/ProjectSettings.scala at master · devhttps/frontend · GitHub
devhttps
/
frontend
Public
forked from
guardian/frontend
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
frontend
/
project
/
ProjectSettings.scala
Copy path
More file actions
More file actions
Latest commit
History
History
History
146 lines (125 loc) · 5.71 KB
Breadcrumbs
frontend
/
project
/
ProjectSettings.scala
Copy path
File metadata and controls
146 lines (125 loc) · 5.71 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
package
com
.
gu
import
com
.
gu
.
versioninfo
.
VersionInfo
import
com
.
typesafe
.
sbt
.
packager
.
universal
.
UniversalPlugin
import
sbt
.
_
import
sbt
.
Keys
.
_
import
com
.
gu
.
riffraff
.
artifact
.
RiffRaffArtifact
import
com
.
gu
.
riffraff
.
artifact
.
RiffRaffArtifact
.
autoImport
.
_
import
Dependencies
.
_
import
play
.
sbt
.{
PlayAkkaHttpServer
,
PlayNettyServer
,
PlayScala
}
import
com
.
typesafe
.
sbt
.
SbtNativePackager
.
Universal
import
com
.
typesafe
.
sbt
.
packager
.
Keys
.
packageName
object
ProjectSettings
{
val
cleanAll
=
taskKey[
Unit
](
"
Cleans all projects in a build, regardless of dependencies
"
)
val
checkScalastyle
=
taskKey[
Unit
](
"
check scalastyle compliance
"
)
val
frontendCompilationSettings
=
Seq
(
organization
:=
"
com.gu
"
,
maxErrors
:=
20
,
javacOptions
:=
Seq
(
"
-g
"
,
"
-encoding
"
,
"
utf8
"
),
scalacOptions
:=
Seq
(
"
-unchecked
"
,
"
-deprecation
"
,
"
-target:jvm-1.8
"
,
"
-Xcheckinit
"
,
"
-encoding
"
,
"
utf8
"
,
"
-feature
"
,
"
-Xfatal-warnings
"
),
publishArtifact in (
Compile
, packageDoc)
:=
false
,
sources in (
Compile
,doc)
:=
Seq
.empty,
doc in
Compile
:=
target.map(_
/
"
none
"
).value,
scalaVersion
:=
"
2.12.4
"
,
initialize
:=
{
val
_
=
initialize.value
assert(sys.props(
"
java.specification.version
"
)
==
"
1.8
"
,
"
Java 8 is required for this project.
"
)
},
cleanAll
:=
Def
.taskDyn {
val
allProjects
=
ScopeFilter
(inAnyProject)
clean.all(allProjects)
}.value
)
val
frontendDependencyManagementSettings
=
Seq
(
ivyXML
:=
<
dependencies
>
<
exclude
org
=
"
commons-logging
"
module
=
"
commons-logging
"
>
<!--
Conflicts
with
jcl
-
over
-
slf4j in
Play
.
--></
exclude
>
</
dependencies
>,
resolvers
++=
Seq
(
Resolver
.typesafeRepo(
"
releases
"
),
Resolver
.sonatypeRepo(
"
releases
"
),
"
Guardian Frontend Bintray
"
at
"
https://dl.bintray.com/guardian/frontend
"
,
"
Guardian Editorial Tools Bintray
"
at
"
https://dl.bintray.com/guardian/editorial-tools
"
,
Resolver
.bintrayRepo(
"
guardian
"
,
"
ophan
"
),
"
Spy
"
at
"
https://files.couchbase.com/maven2/
"
),
evictionWarningOptions in update
:=
EvictionWarningOptions
.default
.withWarnTransitiveEvictions(
false
)
.withWarnDirectEvictions(
false
)
.withWarnScalaVersionEviction(
false
)
)
val
frontendTestSettings
=
Seq
(
//
Use ScalaTest https://groups.google.com/d/topic/play-framework/rZBfNoGtC0M/discussion
testOptions in
Test
:=
Nil
,
concurrentRestrictions in
Global
:=
List
(
Tags
.limit(
Tags
.
Test
,
4
)),
checkScalastyle
:=
org.scalastyle.sbt.
ScalastylePlugin
.autoImport.scalastyle.in(
Test
).toTask(
"
"
).value,
(test in
Test
)
:=
(test in
Test
).dependsOn(checkScalastyle).value,
//
Copy unit test resources https://groups.google.com/d/topic/play-framework/XD3X6R-s5Mc/discussion
unmanagedClasspath in
Test
+=
(baseDirectory map { bd
=>
Attributed
.blank(bd
/
"
test
"
) }).value,
libraryDependencies
++=
Seq
(
scalaTest,
scalaTestPlus,
mockito
),
//
These settings are needed for forking, which in turn is needed for concurrent restrictions.
javaOptions in
Test
+=
"
-DAPP_SECRET=this_is_not_a_real_secret_just_for_tests
"
,
javaOptions in
Test
+=
"
-Xmx2048M
"
,
javaOptions in
Test
+=
"
-XX:+UseConcMarkSweepGC
"
,
javaOptions in
Test
+=
"
-XX:ReservedCodeCacheSize=128m
"
,
baseDirectory in
Test
:=
file(
"
.
"
),
//
Set testResultLogger back to the default, fixes an issue with `sbt-teamcity-logger`
//
See: https://github.com/JetBrains/sbt-tc-logger/issues/9
testResultLogger in (
Test
, test)
:=
TestResultLogger
.
Default
)
val
testAll
=
taskKey[
Unit
](
"
test all aggregate projects
"
)
val
upload
=
taskKey[
Unit
](
"
upload riff-raff artifact from root project
"
)
val
testThenUpload
=
taskKey[
Unit
](
"
Conditional task that uploads to riff raff only if tests pass
"
)
def
frontendRootSettings
:
Seq
[
Def
.
Setting
[
Task
[
Unit
]]]
=
List
(
testAll
:=
(test in
Test
).all(
ScopeFilter
(inAggregates(
ThisProject
, includeRoot
=
false
))).value,
upload
:=
riffRaffUpload.in(
LocalRootProject
).value,
testThenUpload
:=
Def
.taskDyn({
testAll.result.value
match
{
case
Inc
(inc)
=>
Def
.task[
Unit
] {
println(
"
Tests failed, no riff raff upload will be performed.
"
)
throw
inc
}
case
Value
(_)
=>
println(
"
Tests passed, uploading artifact to riff raff.
"
)
upload.toTask
}
}).value
)
def
root
()
:
Project
=
Project
(
"
root
"
, base
=
file(
"
.
"
))
.enablePlugins(
PlayScala
,
RiffRaffArtifact
,
PlayNettyServer
)
.disablePlugins(
PlayAkkaHttpServer
)
.settings(frontendCompilationSettings)
.settings(frontendRootSettings)
def
application
(
applicationName
:
String
)
:
Project
=
{
Project
(applicationName, file(applicationName))
.enablePlugins(
PlayScala
,
UniversalPlugin
)
.settings(frontendDependencyManagementSettings)
.settings(frontendCompilationSettings)
.settings(frontendTestSettings)
.settings(
VersionInfo
.projectSettings)
.settings(libraryDependencies
++=
Seq
(macwire, commonsIo))
.settings(packageName in
Universal
:=
applicationName)
}
def
library
(
applicationName
:
String
)
:
Project
=
{
Project
(applicationName, file(applicationName))
.enablePlugins(
PlayScala
,
PlayNettyServer
)
.disablePlugins(
PlayAkkaHttpServer
)
.settings(frontendDependencyManagementSettings)
.settings(frontendCompilationSettings)
.settings(frontendTestSettings)
.settings(
VersionInfo
.projectSettings)
.settings(libraryDependencies
++=
Seq
(commonsIo))
}
def
filterAssets
(
testAssets
:
Seq
[(
File
,
String
)])
:
Seq
[(
File
,
String
)]
=
testAssets.filterNot {
case
(_, fileName)
=>
//
built in sbt plugins did not like the bower files
fileName.endsWith(
"
bower.json
"
)
}
def
withTests
(
project
:
Project
)
:
ClasspathDep
[
ProjectReference
]
=
project
%
"
test->test;compile->compile
"
}
Back
|
FazBrowse Home
|
New Git URL