mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
daml-sdk-head also installs HEAD jars (#2652)
This commit is contained in:
parent
ddf1c178e3
commit
126ac64bbf
@ -19,6 +19,7 @@ fi
|
||||
|
||||
NUKE=0
|
||||
PROFILING=0
|
||||
SKIP_JARS=0
|
||||
for opt in "$@" ; do
|
||||
case $opt in
|
||||
"--nuke")
|
||||
@ -27,6 +28,9 @@ for opt in "$@" ; do
|
||||
"--profiling")
|
||||
PROFILING=1
|
||||
;;
|
||||
"--skip-jars")
|
||||
SKIP_JARS=1;
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $opt"
|
||||
echo "Available options:"
|
||||
@ -95,3 +99,25 @@ chmod +x $DAML_HOME/bin/daml-head
|
||||
trap - EXIT
|
||||
echo "$(tput setaf 3)Successfully installed daml-head command.$(tput sgr 0)"
|
||||
|
||||
if [ "$SKIP_JARS" -eq "0" ]; then
|
||||
echo "$(tput setaf 3)Installing JARs as 100.0.0...$(tput sgr 0)"
|
||||
|
||||
cp "$REPO_ROOT/VERSION" "$REPO_ROOT/VERSION.head-build-in-progress"
|
||||
|
||||
function cleanup() {
|
||||
echo "$(tput setaf 3)FAILED TO INSTALL JARS! $(tput sgr 0)"
|
||||
mv "$REPO_ROOT/VERSION.head-build-in-progress" "$REPO_ROOT/VERSION"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "0.0.0" > "$REPO_ROOT/VERSION"
|
||||
|
||||
bazel build //release:release
|
||||
tmp=$(mktemp -d)
|
||||
"$REPO_ROOT/bazel-bin/release/release" --artifacts "$REPO_ROOT/release/artifacts.yaml" --release-dir $tmp --all-artifacts --install-head-jars
|
||||
|
||||
mv "$REPO_ROOT/VERSION.head-build-in-progress" "$REPO_ROOT/VERSION"
|
||||
trap - EXIT
|
||||
|
||||
echo "$(tput setaf 3)Done installing JARs as 100.0.0.$(tput sgr 0)"
|
||||
fi
|
||||
|
@ -1,17 +1,19 @@
|
||||
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
|
||||
-- SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE TemplateHaskell, MultiWayIf #-}
|
||||
module Main (main) where
|
||||
|
||||
import Control.Monad.Extra
|
||||
import Control.Monad.IO.Class
|
||||
import Control.Monad.Logger
|
||||
import Data.Yaml
|
||||
import qualified Data.List as List
|
||||
import Path
|
||||
import Path.IO
|
||||
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Maybe as Maybe
|
||||
import qualified System.Directory as Dir
|
||||
import System.Process
|
||||
|
||||
@ -54,8 +56,7 @@ main = do
|
||||
uploadArtifacts <- concatMapM (mavenArtifactCoords optsAllArtifacts) mavenUploadArtifacts
|
||||
validateMavenArtifacts releaseDir uploadArtifacts
|
||||
|
||||
if getPerformUpload upload
|
||||
then do
|
||||
if | getPerformUpload upload -> do
|
||||
$logInfo "Make release"
|
||||
releaseToBintray upload releaseDir (map (\(a, (_, outp)) -> (a, outp)) files)
|
||||
|
||||
@ -70,8 +71,17 @@ main = do
|
||||
-- set variables for next steps in Azure pipelines
|
||||
liftIO . putStrLn $ "##vso[task.setvariable variable=has_released;isOutput=true]true"
|
||||
liftIO . putStrLn . T.unpack $ "##vso[task.setvariable variable=release_tag]" # renderVersion sdkVersion
|
||||
else $logInfo "Make dry run of release"
|
||||
|
||||
| optsLocallyInstallJars -> do
|
||||
let lib_jars = filter (\(mvn,_) -> (artifactType mvn == "jar" || artifactType mvn == "pom") && Maybe.isNothing (classifier mvn)) uploadArtifacts
|
||||
forM_ lib_jars $ \(mvn_coords, path) -> do
|
||||
let args = ["install:install-file",
|
||||
"-Dfile=" <> pathToString releaseDir <> pathToString path,
|
||||
"-DgroupId=" <> foldr (<>) "" (List.intersperse "." $ map T.unpack $ groupId mvn_coords),
|
||||
"-DartifactId=" <> (T.unpack $ artifactId mvn_coords),
|
||||
"-Dversion=100.0.0",
|
||||
"-Dpackaging=" <> (T.unpack $ artifactType mvn_coords)]
|
||||
liftIO $ callProcess "mvn" args
|
||||
| otherwise -> $logInfo "Make dry run of release"
|
||||
where
|
||||
runLog Options{..} m0 = do
|
||||
let m = filterLogger (\_ ll -> ll >= optsLogLevel) m0
|
||||
|
@ -25,6 +25,7 @@ data Options = Options
|
||||
, optsFullLogging :: Bool
|
||||
, optsLogLevel :: LogLevel
|
||||
, optsAllArtifacts :: AllArtifacts
|
||||
, optsLocallyInstallJars :: Bool
|
||||
} deriving (Eq, Show)
|
||||
|
||||
optsParser :: Parser Options
|
||||
@ -36,6 +37,7 @@ optsParser = Options
|
||||
<*> switch (long "full-logging" <> help "full logging detail")
|
||||
<*> option readLogLevel (long "log-level" <> metavar "debug|info|warn|error (default: info)" <> help "Specify log level during release run" <> value LevelInfo )
|
||||
<*> (AllArtifacts <$> switch (long "all-artifacts" <> help "Produce all artifacts including platform-independent artifacts on MacOS"))
|
||||
<*> switch (long "install-head-jars" <> help "install jars to ~/.m2")
|
||||
where
|
||||
readLogLevel :: ReadM LogLevel
|
||||
readLogLevel = do
|
||||
|
@ -11,3 +11,4 @@ HEAD — ongoing
|
||||
|
||||
+ [Sandbox] The sandbox now properly sets the connection pool properties ``minimumIdle``, ``maximumPoolSize``, and ``connectionTimeout``.
|
||||
+ [Java codegen] Fix bug caused the generation of duplicate methods that affected sources with data constructors with type parameters that are either non-unique or not presented in the same order as in the corresponding data type declaration. See `#2367 <https://github.com/digital-asset/daml/issues/2367>`__.
|
||||
* [Dev Tooling] `daml-sdk-head` now installs current-workdir versions of all the published JARs (as version `100.0.0`) to the local Maven repo (`~/.m2`), to allow local testing of unreleased versions of the SDK against JVM-based applications. (Disable with `--skip-jars`)
|
||||
|
Loading…
Reference in New Issue
Block a user