summaryrefslogtreecommitdiff
path: root/scripts/jobs/integrate/ide
blob: ea7d7468229c48fef1ea26fd8ffb5ca7c0fc65fe (plain) (blame)
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
#!/bin/bash -e
# requires checkout: root is a scala checkout with which to integrate (actually, only required file is versions.properties, as documented below)
# requires env: scalaVersion (specifies binary already built from above checkout), WORKSPACE (provided by jenkins), repo_ref (HEAD of the scala checkout),
# requires files: $baseDir/versions.properties (from checkout -- defines version numbers for modules used to build scala for dbuild...)

echo "IDE integration disabled for now on 2.11.x. Punting."
echo "see https://github.com/scala/scala-dev/issues/104"
exit 0

# TODO: remove when integration is up and running
if [ "woele$_scabot_last" != "woele1" ]; then echo "Scabot didn't mark this as last commit -- skipping."; exit 0; fi

baseDir=${WORKSPACE-`pwd`}
uberBuildUrl=${uberBuildUrl-"https://github.com/scala-ide/uber-build.git"}
uberBuildConfig=${uberBuildConfig-"validator.conf"} # TODO: backport to 2.10.x: uberBuildConfig="validator-2.10.conf"

uberBuildDir="$baseDir/uber-build/"

cd $baseDir
if [[ -d $uberBuildDir ]]; then
  ( cd $uberBuildDir && git fetch $uberBuildUrl HEAD && git checkout -f FETCH_HEAD && git clean -fxd )
else
  git clone $uberBuildUrl
fi

echo "maven.version.number=$scalaVersion" >> versions.properties

# pass prRepoUrl in, which uber-build passes along to dbuild (in sbt-builds-for-ide)
# the "-P pr-scala" maven arg accomplishes the same thing for maven (directly used in uber-build)
BASEDIR="$baseDir" prRepoUrl="$prRepoUrl" IDE_M2_REPO="$prRepoUrl" MAVEN_ARGS="-P pr-scala"\
  $uberBuildDir/uber-build.sh $uberBuildDir/config/$uberBuildConfig $repo_ref $scalaVersion

# uber-build puts its local repo under target/m2repo
# wipe the org/scala-lang part, which otherwise just keeps
# growing and growing due to the -$sha-SNAPSHOT approach
[[ -d $baseDir/target/m2repo/org/scala-lang ]] && rm -rf $baseDir/target/m2repo/org/scala-lang