forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce SDK tarball size by 70% by deduplicating Scala dependencies. (d…
…igital-asset#3678) * Start moving all the jars into a single jar. * Fold navigator into daml-sdk jar * include sandbox * Remove unnecessary compileDeps. CHANGELOG_BEGIN - [DAML SDK] Reduced the size of the DAML SDK by about 60% uncompressed, 70% compressed, by deduplicating Scala dependencies. CHANGELOG_END * update copyright header * buildifier fix
- Loading branch information
associahedron
authored
Nov 29, 2019
1 parent
9f18a83
commit 2713d69
Showing
11 changed files
with
182 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Copyright (c) 2019 The DAML Authors. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
load( | ||
"//bazel_tools:scala.bzl", | ||
"da_scala_binary", | ||
"da_scala_library", | ||
) | ||
|
||
compileDeps = [ | ||
|
||
# EXTRACTOR DEPS | ||
"@maven//:io_grpc_grpc_services", # this one has to go first | ||
"@maven//:io_netty_netty_handler", | ||
"@maven//:io_netty_netty_tcnative_boringssl_static", | ||
"@maven//:com_chuusai_shapeless_2_12", | ||
"@maven//:com_lihaoyi_fansi_2_12", | ||
"@maven//:org_spire_math_kind_projector_2_12", | ||
"@maven//:org_typelevel_cats_core_2_12", | ||
"@maven//:org_typelevel_cats_effect_2_12", | ||
"@maven//:org_typelevel_cats_free_2_12", | ||
"@maven//:org_typelevel_cats_kernel_2_12", | ||
"@maven//:com_github_scopt_scopt_2_12", | ||
"@maven//:com_lihaoyi_pprint_2_12", | ||
"@maven//:com_lihaoyi_sourcecode_2_12", | ||
"@maven//:org_tpolecat_doobie_core_2_12", | ||
"@maven//:org_tpolecat_doobie_free_2_12", | ||
"@maven//:org_tpolecat_doobie_postgres_2_12", | ||
"@maven//:com_typesafe_akka_akka_actor_2_12", | ||
"@maven//:com_typesafe_akka_akka_stream_2_12", | ||
"@maven//:org_scalaz_scalaz_core_2_12", | ||
"@maven//:org_slf4j_slf4j_api", | ||
"@maven//:com_typesafe_scala_logging_scala_logging_2_12", | ||
"@maven//:io_circe_circe_core_2_12", | ||
"@maven//:io_circe_circe_generic_2_12", | ||
"@maven//:io_circe_circe_parser_2_12", | ||
"@maven//:io_spray_spray_json_2_12", | ||
"@maven//:io_grpc_grpc_netty", | ||
|
||
# NAVIGATOR DEPS | ||
"@maven//:com_github_pureconfig_pureconfig_2_12", | ||
"@maven//:com_typesafe_akka_akka_http_2_12", | ||
"@maven//:com_typesafe_akka_akka_http_core_2_12", | ||
"@maven//:com_typesafe_akka_akka_http_spray_json_2_12", | ||
"@maven//:com_typesafe_akka_akka_slf4j_2_12", | ||
"@maven//:com_typesafe_akka_akka_stream_testkit_2_12", | ||
"@maven//:com_typesafe_config", | ||
"@maven//:ch_qos_logback_logback_classic", | ||
"@maven//:org_sangria_graphql_sangria_2_12", | ||
"@maven//:org_sangria_graphql_sangria_marshalling_api_2_12", | ||
"@maven//:org_sangria_graphql_sangria_spray_json_2_12", | ||
"@maven//:org_jline_jline", | ||
"@maven//:org_jline_jline_reader", | ||
"@maven//:org_scala_lang_modules_scala_parser_combinators_2_12", | ||
"@maven//:org_gnieh_diffson_core_2_12", | ||
"@maven//:org_gnieh_diffson_spray_json_2_12", | ||
"@maven//:org_xerial_sqlite_jdbc", | ||
] | ||
|
||
runtimeDeps = [ | ||
"@maven//:ch_qos_logback_logback_classic", | ||
"@maven//:ch_qos_logback_logback_core", | ||
] | ||
|
||
da_scala_library( | ||
name = "sdk-lib", | ||
srcs = glob(["src/main/scala/**/*.scala"]), | ||
resources = glob(["src/main/resources/**/*"]), | ||
visibility = ["//visibility:public"], | ||
runtime_deps = runtimeDeps, | ||
deps = compileDeps + [ | ||
"//triggers/runner:trigger-runner-lib", | ||
"//daml-script/runner:script-runner-lib", | ||
"//language-support/codegen-main:codegen-main-lib", | ||
"//extractor:extractor", | ||
"//ledger-service/http-json:http-json", | ||
"//navigator/backend:navigator-library", | ||
"//ledger/sandbox:sandbox", | ||
], | ||
) | ||
|
||
da_scala_binary( | ||
name = "sdk", | ||
main_class = "com.digitalasset.daml.sdk.SdkMain", | ||
tags = ["maven_coordinates=com.digitalasset.daml.sdk:sdk:__VERSION__"], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
":sdk-lib", | ||
"//navigator/backend:backend-resources", | ||
"//navigator/backend:frontend-resources", | ||
"//navigator/backend:version-resource", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<logger name="io.netty" level="WARN" /> | ||
<logger name="io.grpc.netty" level="WARN" /> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="STDOUT" /> | ||
</root> | ||
</configuration> |
29 changes: 29 additions & 0 deletions
29
daml-assistant/daml-sdk/src/main/scala/com/digitalasset/daml/sdk/SdkMain.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) 2019 The DAML Authors. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package com.digitalasset.daml.sdk | ||
import com.digitalasset.daml.lf.engine.trigger.{RunnerMain => Trigger} | ||
import com.digitalasset.daml.lf.engine.script.{RunnerMain => Script} | ||
import com.digitalasset.codegen.{CodegenMain => Codegen} | ||
import com.digitalasset.extractor.{Main => Extractor} | ||
import com.digitalasset.http.{Main => JsonApi} | ||
import com.digitalasset.navigator.{NavigatorBackend => Navigator} | ||
import com.digitalasset.platform.sandbox.{SandboxMain => Sandbox} | ||
|
||
object SdkMain { | ||
def main(args: Array[String]): Unit = { | ||
val command = args(0) | ||
val rest = args.drop(1) | ||
command match { | ||
case "trigger" => Trigger.main(rest) | ||
case "script" => Script.main(rest) | ||
case "codegen" => Codegen.main(rest) | ||
case "extractor" => Extractor.main(rest) | ||
case "json-api" => JsonApi.main(rest) | ||
case "navigator" => Navigator.main(rest) | ||
case "sandbox" => Sandbox.main(rest) | ||
case _ => sys.exit(1) | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters