Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
270578f2
Commit
270578f2
authored
8 years ago
by
Nicolas Voirol
Browse files
Options
Downloads
Patches
Plain Diff
Added svn+credentials resolver scheme to sbt build
parent
382f1a2f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.sbt
+7
-4
7 additions, 4 deletions
build.sbt
project/Build.scala
+51
-0
51 additions, 0 deletions
project/Build.scala
with
58 additions
and
4 deletions
build.sbt
+
7
−
4
View file @
270578f2
...
...
@@ -55,12 +55,15 @@ lazy val ItTest = config("it") extend(Test)
testOptions
in
ItTest
:=
Seq
(
Tests
.
Argument
(
"-oDF"
))
def
ghProject
(
repo
:
String
,
version
:
String
)
=
RootProject
(
uri
(
s
"$
{
repo
}
#$
{
version
}
"
))
def
ghProject
(
repo
:
String
,
version
:
String
)
=
RootProject
(
uri
(
s
"
git://
$repo#$version"
))
lazy
val
bonsai
=
ghProject
(
"git://github.com/colder/bonsai.git"
,
"10eaaee4ea0ff6567f4f866922cb871bae2da0ac"
)
lazy
val
scalaSmtlib
=
ghProject
(
"git://github.com/regb/scala-smtlib.git"
,
"850580ae86e299a1baa0eaef9e24eed905fefe58
"
)
def
svnProject
(
repo
:
String
,
version
:
String
,
user
:
String
,
pass
:
String
)
=
RootProject
(
uri
(
s
"svn+credentials://$repo#username=$user&password=$pass&$version
"
)
)
lazy
val
princess
=
ghProject
(
"svn://hal4.it.uu.se/princess/interpolation/trunk"
,
"2703"
)
lazy
val
bonsai
=
ghProject
(
"github.com/colder/bonsai.git"
,
"10eaaee4ea0ff6567f4f866922cb871bae2da0ac"
)
lazy
val
scalaSmtlib
=
ghProject
(
"github.com/regb/scala-smtlib.git"
,
"850580ae86e299a1baa0eaef9e24eed905fefe58"
)
lazy
val
princess
=
svnProject
(
"hal4.it.uu.se/princess/interpolation/trunk"
,
"2703"
,
"anonymous"
,
"anonymous"
)
// XXX @nv: complex hack to make sure we don't have a name clash between
// princess' smtlib parser and the scala-smtlib one.
...
...
This diff is collapsed.
Click to expand it.
project/Build.scala
0 → 100644
+
51
−
0
View file @
270578f2
import
sbt._
import
Keys._
import
RichURI._
object
InoxBuild
extends
Build
{
override
def
buildLoaders
=
BuildLoader
.
resolve
(
svnResolver
)
::
Nil
// Define the custom resolver which handles the 'svn' scheme with a username/password pair.
def
svnResolver
(
info
:
BuildLoader.ResolveInfo
)
:
Option
[()
=>
File
]
=
if
(
info
.
uri
.
getScheme
!=
"svn+credentials"
)
None
else
{
val
uri
=
info
.
uri
.
withoutMarkerScheme
val
localCopy
=
Resolvers
.
uniqueSubdirectoryFor
(
uri
,
in
=
info
.
staging
)
val
from
=
uri
.
copy
(
scheme
=
"svn"
).
withoutFragment
.
toASCIIString
val
to
=
localCopy
.
getAbsolutePath
sealed
abstract
class
SVNInfo
case
class
Username
(
user
:
String
)
extends
SVNInfo
case
class
Password
(
pass
:
String
)
extends
SVNInfo
case
class
Tag
(
tag
:
String
)
extends
SVNInfo
val
fragment
=
uri
.
getFragment
val
splits
=
fragment
.
split
(
"&"
).
toSeq
val
infos
=
splits
.
map
(
s
=>
s
.
split
(
"="
).
toSeq
match
{
case
Seq
(
"username"
,
user
)
=>
Username
(
user
)
case
Seq
(
"password"
,
pass
)
=>
Password
(
pass
)
case
Seq
(
tag
)
=>
Tag
(
tag
)
case
_
=>
sys
.
error
(
"Unexpected fragment: "
+
fragment
)
})
val
username
=
infos
.
collect
{
case
Username
(
user
)
=>
user
}
match
{
case
Seq
(
user
)
=>
user
case
_
=>
sys
.
error
(
"Invalid username specification for svn+credentials scheme."
)
}
val
password
=
infos
.
collect
{
case
Password
(
pass
)
=>
pass
}
match
{
case
Seq
(
pass
)
=>
pass
case
_
=>
sys
.
error
(
"Invalid password specification for svn+credentials scheme."
)
}
infos
.
collect
{
case
Tag
(
tag
)
=>
tag
}
match
{
case
Seq
(
tag
)
=>
Some
(()
=>
Resolvers
.
creates
(
localCopy
)
{
Resolvers
.
run
(
"svn"
,
"checkout"
,
"-q"
,
"-r"
,
tag
,
"--username"
,
username
,
"--password"
,
password
,
from
,
to
)
})
case
Seq
()
=>
Some
(()
=>
Resolvers
.
creates
(
localCopy
)
{
Resolvers
.
run
(
"svn"
,
"checkout"
,
"-q"
,
"--username"
,
username
,
"--password"
,
password
,
from
,
to
)
})
case
_
=>
sys
.
error
(
"Invalid tag specification for svn+credentials scheme."
)
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment