You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gearpump.apache.org by manuzhang <gi...@git.apache.org> on 2016/11/02 15:38:59 UTC

[GitHub] incubator-gearpump pull request #108: [GEARPUMP-226] enforce assembly shaded...

GitHub user manuzhang opened a pull request:

    https://github.com/apache/incubator-gearpump/pull/108

    [GEARPUMP-226] enforce assembly shaded library first

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/manuzhang/incubator-gearpump fix_build

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-gearpump/pull/108.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #108
    
----
commit 83507287927fa539a147f31436a24d4bc7240479
Author: manuzhang <ow...@gmail.com>
Date:   2016-11-02T15:36:42Z

    [GEARPUMP-226] enforce assembly shaded library first

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump pull request #108: [GEARPUMP-226] refactor build files

Posted by huafengw <gi...@git.apache.org>.
Github user huafengw commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/108#discussion_r86914195
  
    --- Diff: project/BuildExperiments.scala ---
    @@ -0,0 +1,118 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +import BuildGearpump._
    +import BuildDashboard.services
    +import Dependencies._
    +import sbt._
    +import sbt.Keys._
    +
    +object BuildExperiments extends sbt.Build {
    +
    +  lazy val experiments: Seq[ProjectReference] = Seq(
    +    // akkastream,
    +    cgroup,
    +    redis,
    +    storm,
    +    yarn
    +  )
    +
    +  lazy val yarn = Project(
    +    id = "gearpump-experiments-yarn",
    +    base = file("experiments/yarn"),
    +    settings = commonSettings ++ noPublish ++
    +      Seq(
    +        libraryDependencies ++= Seq(
    +          "org.apache.hadoop" % "hadoop-yarn-api" % hadoopVersion,
    +          "org.apache.hadoop" % "hadoop-yarn-client" % hadoopVersion,
    +          "org.apache.hadoop" % "hadoop-yarn-common" % hadoopVersion,
    +          "commons-httpclient" % "commons-httpclient" % commonsHttpVersion,
    +          "org.apache.hadoop" % "hadoop-mapreduce-client-core" % hadoopVersion,
    +          "org.apache.hadoop" % "hadoop-yarn-server-resourcemanager" % hadoopVersion % "provided",
    +          "org.apache.hadoop" % "hadoop-yarn-server-nodemanager" % hadoopVersion % "provided"
    +        )
    +      ))
    +    .dependsOn(services % "test->test;compile->compile",
    +      core % "provided", gearpumpHadoop).disablePlugins(sbtassembly.AssemblyPlugin)
    +
    +  lazy val akkastream = Project(
    +    id = "gearpump-experiments-akkastream",
    +    base = file("experiments/akkastream"),
    +    settings = commonSettings ++ noPublish ++ myAssemblySettings ++
    +      Seq(
    +        libraryDependencies ++= Seq(
    +          "org.json4s" %% "json4s-jackson" % "3.2.11"
    +        ),
    +        mainClass in(Compile, packageBin) := Some("akka.stream.gearpump.example.Test")
    +      ))
    +    .dependsOn(core % "provided", streaming % "test->test; provided")
    +
    +  lazy val redis = Project(
    +    id = "gearpump-experiments-redis",
    +    base = file("experiments/redis"),
    +    settings = commonSettings ++ noPublish ++
    +      Seq(
    +        libraryDependencies ++= Seq(
    +          "redis.clients" % "jedis" % "2.9.0"
    --- End diff --
    
    extract the redis version


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump pull request #108: [GEARPUMP-226] refactor build files

Posted by huafengw <gi...@git.apache.org>.
Github user huafengw commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/108#discussion_r86915001
  
    --- Diff: project/BuildGearpump.scala ---
    @@ -0,0 +1,258 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +import com.typesafe.sbt.SbtPgp.autoImport._
    +import BuildExamples.examples
    +import BuildExperiments.experiments
    +import BuildExternals.externals
    +import BuildIntegrationTests.integrationTests
    +import BuildDashboard.services
    +import Dependencies._
    +import Docs._
    +import de.johoop.jacoco4sbt.JacocoPlugin.jacoco
    +import sbt.Keys._
    +import sbt._
    +import Pack.packProject
    +import sbtassembly.AssemblyPlugin.autoImport._
    +
    +import xerial.sbt.Sonatype._
    +
    +object BuildGearpump extends sbt.Build {
    +
    +  val apacheRepo = "https://repository.apache.org/"
    +  val distDirectory = "output"
    +  val projectName = "gearpump"
    +
    +  val commonSettings = Seq(jacoco.settings: _*) ++ sonatypeSettings ++
    +    Seq(
    +      resolvers ++= Seq(
    +        "patriknw at bintray" at "http://dl.bintray.com/patriknw/maven",
    +        "apache-repo" at "https://repository.apache.org/content/repositories",
    +        "maven1-repo" at "http://repo1.maven.org/maven2",
    +        "maven2-repo" at "http://mvnrepository.com/artifact",
    +        "sonatype" at "https://oss.sonatype.org/content/repositories/releases",
    +        "bintray/non" at "http://dl.bintray.com/non/maven",
    +        "clockfly" at "http://dl.bintray.com/clockfly/maven",
    +        "clojars" at "http://clojars.org/repo"
    +      )
    +      // ,addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full)
    +    ) ++
    +    Seq(
    +      scalaVersion := scalaVersionNumber,
    +      crossScalaVersions := crossScalaVersionNumbers,
    +      organization := "org.apache.gearpump",
    +      useGpg := false,
    +      pgpSecretRing := file("./secring.asc"),
    +      pgpPublicRing := file("./pubring.asc"),
    +      scalacOptions ++= Seq("-Yclosure-elim", "-Yinline"),
    +      publishMavenStyle := true,
    +
    +      pgpPassphrase := Option(System.getenv().get("PASSPHRASE")).map(_.toArray),
    +      credentials += Credentials(
    +        "Sonatype Nexus Repository Manager",
    +        "repository.apache.org",
    +        System.getenv().get("SONATYPE_USERNAME"),
    +        System.getenv().get("SONATYPE_PASSWORD")),
    +
    +      pomIncludeRepository := { _ => false },
    +
    +      publishTo := {
    +        if (isSnapshot.value) {
    +          Some("snapshots" at apacheRepo + "content/repositories/snapshots")
    +        } else {
    +          Some("releases" at apacheRepo + "content/repositories/releases")
    +        }
    +      },
    +
    +      publishArtifact in Test := true,
    +
    +      pomExtra := {
    +        <url>https://github.com/apache/incubator-gearpump</url>
    +          <licenses>
    +            <license>
    +              <name>Apache 2</name>
    +              <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    +            </license>
    +          </licenses>
    +          <scm>
    +            <connection>scm:git://git.apache.org/incubator-gearpump.git</connection>
    +            <developerConnection>scm:git:git@github.com:apache/incubator-gearpump</developerConnection>
    +            <url>github.com/apache/incubator-gearpump</url>
    +          </scm>
    +          <developers>
    +            <developer>
    +              <id>gearpump</id>
    +              <name>Gearpump Team</name>
    +              <url>http://gearpump.incubator.apache.org/community.html#who-we-are</url>
    +            </developer>
    +          </developers>
    +      }
    +    )
    +
    +  val noPublish = Seq(
    +    publish := {},
    +    publishLocal := {},
    +    publishArtifact := false,
    +    publishArtifact in Test := false
    +  )
    +
    +
    +
    +  lazy val myAssemblySettings = Seq(
    +    test in assembly := {},
    +    assemblyOption in assembly ~= {
    +      _.copy(includeScala = false)
    +    },
    +    assemblyJarName in assembly := {
    +      s"${name.value}_${scalaBinaryVersion.value}-${version.value}.jar"
    +    },
    +    target in assembly := baseDirectory.value / "target" / scalaBinaryVersion.value
    +  )
    +
    +  lazy val aggregated: Seq[ProjectReference] = Seq[ProjectReference](
    +    core,
    +    streaming,
    +    services,
    +    gearpumpHadoop,
    +    packProject
    +  ) ++ examples ++ experiments ++ externals ++ integrationTests
    +
    +  lazy val root = Project(
    +    id = "gearpump",
    +    base = file("."),
    +    settings = commonSettings ++ noPublish ++ gearpumpUnidocSetting,
    +    aggregate = aggregated)
    +    .settings(Defaults.itSettings: _*)
    +    .disablePlugins(sbtassembly.AssemblyPlugin)
    +
    +  lazy val core = Project(
    +    id = "gearpump-core",
    +    base = file("core"),
    +    settings = commonSettings ++ myAssemblySettings ++ javadocSettings ++ coreDependencies ++
    +      addArtifact(Artifact("gearpump-core"), sbtassembly.AssemblyKeys.assembly) ++ Seq(
    +      assemblyShadeRules in assembly := Seq(
    +        ShadeRule.zap("akka.**").inAll,
    +        ShadeRule.zap("com.google.protobuf.**").inAll,
    +        ShadeRule.zap("com.typesafe.**").inAll,
    +        ShadeRule.zap("net.jpountz.**").inAll,
    +        ShadeRule.zap("org.apache.commons.**").inAll,
    +        ShadeRule.zap("org.apache.log4j.**").inAll,
    +        ShadeRule.zap("org.jboss.**").inAll,
    +        ShadeRule.zap("org.objectweb.**").inAll,
    +        ShadeRule.zap("org.reactivestreams.**").inAll,
    +        ShadeRule.zap("org.slf4j.**").inAll,
    +        ShadeRule.zap("org.uncommons.maths.**").inAll,
    +        ShadeRule.zap("scala.**").inAll,
    +        ShadeRule.zap("spray.**").inAll,
    +        ShadeRule.rename("com.romix.**" -> "org.apache.gearpump.romix.@1").inAll,
    +        ShadeRule.rename("com.esotericsoftware.**" ->
    +          "org.apache.gearpump.esotericsoftware.@1").inAll,
    +        ShadeRule.rename("org.objenesis.**" -> "org.apache.gearpump.objenesis.@1").inAll,
    +        ShadeRule.rename("com.google.**" -> "org.apache.gearpump.google.@1").inAll,
    +        ShadeRule.rename("com.codahale.metrics.**" ->
    +          "org.apache.gearpump.codahale.metrics.@1").inAll
    +      ),
    +
    +      pomPostProcess := {
    +        (node: xml.Node) => changeShadedDeps(
    +          Set(
    +            "com.github.romix.akka",
    +            "com.google.guava",
    +            "com.codahale.metrics",
    +            "org.scala-lang",
    +            "org.scoverage"
    +          ), List.empty[xml.Node], node)
    +      }
    +    ))
    +
    +  lazy val streaming = Project(
    +    id = "gearpump-streaming",
    +    base = file("streaming"),
    +    settings = commonSettings ++ myAssemblySettings ++ javadocSettings ++
    +      addArtifact(Artifact("gearpump-streaming"), sbtassembly.AssemblyKeys.assembly) ++
    +      Seq(
    +        assemblyShadeRules in assembly := Seq(
    +          ShadeRule.rename("com.gs.collections.**" ->
    +            "org.apache.gearpump.gs.collections.@1").inAll
    +        ),
    +
    +        assemblyMergeStrategy in assembly := {
    +          case "geardefault.conf" =>
    +            MergeStrategy.last
    +          case x =>
    +            val oldStrategy = (assemblyMergeStrategy in assembly).value
    +            oldStrategy(x)
    +        },
    +
    +        libraryDependencies ++= Seq(
    +          "com.goldmansachs" % "gs-collections" % gsCollectionsVersion
    +        ),
    +
    +        pomPostProcess := {
    --- End diff --
    
    I don't get it. These shaded library are already been assembled into the gearpump-core jar file right, which means there should not be any dependency any more?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump pull request #108: [GEARPUMP-226] refactor build files

Posted by manuzhang <gi...@git.apache.org>.
Github user manuzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/108#discussion_r86914633
  
    --- Diff: project/BuildGearpump.scala ---
    @@ -0,0 +1,258 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +import com.typesafe.sbt.SbtPgp.autoImport._
    +import BuildExamples.examples
    +import BuildExperiments.experiments
    +import BuildExternals.externals
    +import BuildIntegrationTests.integrationTests
    +import BuildDashboard.services
    +import Dependencies._
    +import Docs._
    +import de.johoop.jacoco4sbt.JacocoPlugin.jacoco
    +import sbt.Keys._
    +import sbt._
    +import Pack.packProject
    +import sbtassembly.AssemblyPlugin.autoImport._
    +
    +import xerial.sbt.Sonatype._
    +
    +object BuildGearpump extends sbt.Build {
    +
    +  val apacheRepo = "https://repository.apache.org/"
    +  val distDirectory = "output"
    +  val projectName = "gearpump"
    +
    +  val commonSettings = Seq(jacoco.settings: _*) ++ sonatypeSettings ++
    +    Seq(
    +      resolvers ++= Seq(
    +        "patriknw at bintray" at "http://dl.bintray.com/patriknw/maven",
    +        "apache-repo" at "https://repository.apache.org/content/repositories",
    +        "maven1-repo" at "http://repo1.maven.org/maven2",
    +        "maven2-repo" at "http://mvnrepository.com/artifact",
    +        "sonatype" at "https://oss.sonatype.org/content/repositories/releases",
    +        "bintray/non" at "http://dl.bintray.com/non/maven",
    +        "clockfly" at "http://dl.bintray.com/clockfly/maven",
    +        "clojars" at "http://clojars.org/repo"
    +      )
    +      // ,addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full)
    +    ) ++
    +    Seq(
    +      scalaVersion := scalaVersionNumber,
    +      crossScalaVersions := crossScalaVersionNumbers,
    +      organization := "org.apache.gearpump",
    +      useGpg := false,
    +      pgpSecretRing := file("./secring.asc"),
    +      pgpPublicRing := file("./pubring.asc"),
    +      scalacOptions ++= Seq("-Yclosure-elim", "-Yinline"),
    +      publishMavenStyle := true,
    +
    +      pgpPassphrase := Option(System.getenv().get("PASSPHRASE")).map(_.toArray),
    +      credentials += Credentials(
    +        "Sonatype Nexus Repository Manager",
    +        "repository.apache.org",
    +        System.getenv().get("SONATYPE_USERNAME"),
    +        System.getenv().get("SONATYPE_PASSWORD")),
    +
    +      pomIncludeRepository := { _ => false },
    +
    +      publishTo := {
    +        if (isSnapshot.value) {
    +          Some("snapshots" at apacheRepo + "content/repositories/snapshots")
    +        } else {
    +          Some("releases" at apacheRepo + "content/repositories/releases")
    +        }
    +      },
    +
    +      publishArtifact in Test := true,
    +
    +      pomExtra := {
    +        <url>https://github.com/apache/incubator-gearpump</url>
    +          <licenses>
    +            <license>
    +              <name>Apache 2</name>
    +              <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    +            </license>
    +          </licenses>
    +          <scm>
    +            <connection>scm:git://git.apache.org/incubator-gearpump.git</connection>
    +            <developerConnection>scm:git:git@github.com:apache/incubator-gearpump</developerConnection>
    +            <url>github.com/apache/incubator-gearpump</url>
    +          </scm>
    +          <developers>
    +            <developer>
    +              <id>gearpump</id>
    +              <name>Gearpump Team</name>
    +              <url>http://gearpump.incubator.apache.org/community.html#who-we-are</url>
    +            </developer>
    +          </developers>
    +      }
    +    )
    +
    +  val noPublish = Seq(
    +    publish := {},
    +    publishLocal := {},
    +    publishArtifact := false,
    +    publishArtifact in Test := false
    +  )
    +
    +
    +
    +  lazy val myAssemblySettings = Seq(
    +    test in assembly := {},
    +    assemblyOption in assembly ~= {
    +      _.copy(includeScala = false)
    +    },
    +    assemblyJarName in assembly := {
    +      s"${name.value}_${scalaBinaryVersion.value}-${version.value}.jar"
    +    },
    +    target in assembly := baseDirectory.value / "target" / scalaBinaryVersion.value
    +  )
    +
    +  lazy val aggregated: Seq[ProjectReference] = Seq[ProjectReference](
    +    core,
    +    streaming,
    +    services,
    +    gearpumpHadoop,
    +    packProject
    +  ) ++ examples ++ experiments ++ externals ++ integrationTests
    +
    +  lazy val root = Project(
    +    id = "gearpump",
    +    base = file("."),
    +    settings = commonSettings ++ noPublish ++ gearpumpUnidocSetting,
    +    aggregate = aggregated)
    +    .settings(Defaults.itSettings: _*)
    +    .disablePlugins(sbtassembly.AssemblyPlugin)
    +
    +  lazy val core = Project(
    +    id = "gearpump-core",
    +    base = file("core"),
    +    settings = commonSettings ++ myAssemblySettings ++ javadocSettings ++ coreDependencies ++
    +      addArtifact(Artifact("gearpump-core"), sbtassembly.AssemblyKeys.assembly) ++ Seq(
    +      assemblyShadeRules in assembly := Seq(
    +        ShadeRule.zap("akka.**").inAll,
    +        ShadeRule.zap("com.google.protobuf.**").inAll,
    +        ShadeRule.zap("com.typesafe.**").inAll,
    +        ShadeRule.zap("net.jpountz.**").inAll,
    +        ShadeRule.zap("org.apache.commons.**").inAll,
    +        ShadeRule.zap("org.apache.log4j.**").inAll,
    +        ShadeRule.zap("org.jboss.**").inAll,
    +        ShadeRule.zap("org.objectweb.**").inAll,
    +        ShadeRule.zap("org.reactivestreams.**").inAll,
    +        ShadeRule.zap("org.slf4j.**").inAll,
    +        ShadeRule.zap("org.uncommons.maths.**").inAll,
    +        ShadeRule.zap("scala.**").inAll,
    +        ShadeRule.zap("spray.**").inAll,
    +        ShadeRule.rename("com.romix.**" -> "org.apache.gearpump.romix.@1").inAll,
    +        ShadeRule.rename("com.esotericsoftware.**" ->
    +          "org.apache.gearpump.esotericsoftware.@1").inAll,
    +        ShadeRule.rename("org.objenesis.**" -> "org.apache.gearpump.objenesis.@1").inAll,
    +        ShadeRule.rename("com.google.**" -> "org.apache.gearpump.google.@1").inAll,
    +        ShadeRule.rename("com.codahale.metrics.**" ->
    +          "org.apache.gearpump.codahale.metrics.@1").inAll
    +      ),
    +
    +      pomPostProcess := {
    +        (node: xml.Node) => changeShadedDeps(
    +          Set(
    +            "com.github.romix.akka",
    +            "com.google.guava",
    +            "com.codahale.metrics",
    +            "org.scala-lang",
    +            "org.scoverage"
    +          ), List.empty[xml.Node], node)
    +      }
    +    ))
    +
    +  lazy val streaming = Project(
    +    id = "gearpump-streaming",
    +    base = file("streaming"),
    +    settings = commonSettings ++ myAssemblySettings ++ javadocSettings ++
    +      addArtifact(Artifact("gearpump-streaming"), sbtassembly.AssemblyKeys.assembly) ++
    +      Seq(
    +        assemblyShadeRules in assembly := Seq(
    +          ShadeRule.rename("com.gs.collections.**" ->
    +            "org.apache.gearpump.gs.collections.@1").inAll
    +        ),
    +
    +        assemblyMergeStrategy in assembly := {
    +          case "geardefault.conf" =>
    +            MergeStrategy.last
    +          case x =>
    +            val oldStrategy = (assemblyMergeStrategy in assembly).value
    +            oldStrategy(x)
    +        },
    +
    +        libraryDependencies ++= Seq(
    +          "com.goldmansachs" % "gs-collections" % gsCollectionsVersion
    +        ),
    +
    +        pomPostProcess := {
    --- End diff --
    
    I'm afraid so. The managed dependencies to shade have to be excluded and I also add "gearpump-core" to published pom of "gearpump-streaming".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump issue #108: [GEARPUMP-226] refactor build files

Posted by manuzhang <gi...@git.apache.org>.
Github user manuzhang commented on the issue:

    https://github.com/apache/incubator-gearpump/pull/108
  
    @huafengw please review. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump issue #108: [GEARPUMP-226] refactor build files

Posted by huafengw <gi...@git.apache.org>.
Github user huafengw commented on the issue:

    https://github.com/apache/incubator-gearpump/pull/108
  
    +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump pull request #108: [GEARPUMP-226] refactor build files

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-gearpump/pull/108


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump issue #108: [GEARPUMP-226] refactor build files

Posted by codecov-io <gi...@git.apache.org>.
Github user codecov-io commented on the issue:

    https://github.com/apache/incubator-gearpump/pull/108
  
    ## [Current coverage](https://codecov.io/gh/apache/incubator-gearpump/pull/108?src=pr) is 72.91% (diff: 100%)
    > Merging [#108](https://codecov.io/gh/apache/incubator-gearpump/pull/108?src=pr) into [master](https://codecov.io/gh/apache/incubator-gearpump/branch/master?src=pr) will increase coverage by **1.17%**
    
    
    ```diff
    @@             master       #108   diff @@
    ==========================================
      Files           186        186          
      Lines          5981       5981          
      Methods        5456       5462     +6   
      Messages          0          0          
      Branches        525        517     -8   
    ==========================================
    + Hits           4291       4361    +70   
    + Misses         1690       1620    -70   
      Partials          0          0          
    ```
    
    ![Sunburst](https://codecov.io/gh/apache/incubator-gearpump/pull/108/graphs/sunburst.svg?src=pr&size=150)
    
    > Powered by [Codecov](https://codecov.io?src=pr). Last update [cbf59fb...8631b62](https://codecov.io/gh/apache/incubator-gearpump/compare/cbf59fb77834914116657a135b30899b91a7408d...8631b6271cf225ea7e01f8df585744c4c99954aa?src=pr)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump pull request #108: [GEARPUMP-226] refactor build files

Posted by huafengw <gi...@git.apache.org>.
Github user huafengw commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/108#discussion_r86913888
  
    --- Diff: integrationtest/core/src/it/scala/org/apache/gearpump/integrationtest/suites/StandaloneModeSuite.scala ---
    @@ -28,14 +28,14 @@ import org.apache.gearpump.integrationtest.minicluster.MiniCluster
      * test spec, you need to comment out other lines.
      */
     class StandaloneModeSuite extends Suites(
    -  new CommandLineSpec,
    -  new RestServiceSpec,
    -  new ExampleSpec,
    -  new DynamicDagSpec,
    -  new StormCompatibilitySpec,
    -  new StabilitySpec,
    -  new ConnectorKafkaSpec,
    -  new MessageDeliverySpec
    +  // new CommandLineSpec,
    +  // new RestServiceSpec,
    +  new ExampleSpec //,
    +  // new DynamicDagSpec,
    +  // new StormCompatibilitySpec,
    +  // new StabilitySpec,
    +  // new ConnectorKafkaSpec,
    +  // new MessageDeliverySpec
    --- End diff --
    
    unnecessary change


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump pull request #108: [GEARPUMP-226] refactor build files

Posted by manuzhang <gi...@git.apache.org>.
Github user manuzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/108#discussion_r86915123
  
    --- Diff: project/BuildGearpump.scala ---
    @@ -0,0 +1,258 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +import com.typesafe.sbt.SbtPgp.autoImport._
    +import BuildExamples.examples
    +import BuildExperiments.experiments
    +import BuildExternals.externals
    +import BuildIntegrationTests.integrationTests
    +import BuildDashboard.services
    +import Dependencies._
    +import Docs._
    +import de.johoop.jacoco4sbt.JacocoPlugin.jacoco
    +import sbt.Keys._
    +import sbt._
    +import Pack.packProject
    +import sbtassembly.AssemblyPlugin.autoImport._
    +
    +import xerial.sbt.Sonatype._
    +
    +object BuildGearpump extends sbt.Build {
    +
    +  val apacheRepo = "https://repository.apache.org/"
    +  val distDirectory = "output"
    +  val projectName = "gearpump"
    +
    +  val commonSettings = Seq(jacoco.settings: _*) ++ sonatypeSettings ++
    +    Seq(
    +      resolvers ++= Seq(
    +        "patriknw at bintray" at "http://dl.bintray.com/patriknw/maven",
    +        "apache-repo" at "https://repository.apache.org/content/repositories",
    +        "maven1-repo" at "http://repo1.maven.org/maven2",
    +        "maven2-repo" at "http://mvnrepository.com/artifact",
    +        "sonatype" at "https://oss.sonatype.org/content/repositories/releases",
    +        "bintray/non" at "http://dl.bintray.com/non/maven",
    +        "clockfly" at "http://dl.bintray.com/clockfly/maven",
    +        "clojars" at "http://clojars.org/repo"
    +      )
    +      // ,addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full)
    +    ) ++
    +    Seq(
    +      scalaVersion := scalaVersionNumber,
    +      crossScalaVersions := crossScalaVersionNumbers,
    +      organization := "org.apache.gearpump",
    +      useGpg := false,
    +      pgpSecretRing := file("./secring.asc"),
    +      pgpPublicRing := file("./pubring.asc"),
    +      scalacOptions ++= Seq("-Yclosure-elim", "-Yinline"),
    +      publishMavenStyle := true,
    +
    +      pgpPassphrase := Option(System.getenv().get("PASSPHRASE")).map(_.toArray),
    +      credentials += Credentials(
    +        "Sonatype Nexus Repository Manager",
    +        "repository.apache.org",
    +        System.getenv().get("SONATYPE_USERNAME"),
    +        System.getenv().get("SONATYPE_PASSWORD")),
    +
    +      pomIncludeRepository := { _ => false },
    +
    +      publishTo := {
    +        if (isSnapshot.value) {
    +          Some("snapshots" at apacheRepo + "content/repositories/snapshots")
    +        } else {
    +          Some("releases" at apacheRepo + "content/repositories/releases")
    +        }
    +      },
    +
    +      publishArtifact in Test := true,
    +
    +      pomExtra := {
    +        <url>https://github.com/apache/incubator-gearpump</url>
    +          <licenses>
    +            <license>
    +              <name>Apache 2</name>
    +              <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    +            </license>
    +          </licenses>
    +          <scm>
    +            <connection>scm:git://git.apache.org/incubator-gearpump.git</connection>
    +            <developerConnection>scm:git:git@github.com:apache/incubator-gearpump</developerConnection>
    +            <url>github.com/apache/incubator-gearpump</url>
    +          </scm>
    +          <developers>
    +            <developer>
    +              <id>gearpump</id>
    +              <name>Gearpump Team</name>
    +              <url>http://gearpump.incubator.apache.org/community.html#who-we-are</url>
    +            </developer>
    +          </developers>
    +      }
    +    )
    +
    +  val noPublish = Seq(
    +    publish := {},
    +    publishLocal := {},
    +    publishArtifact := false,
    +    publishArtifact in Test := false
    +  )
    +
    +
    +
    +  lazy val myAssemblySettings = Seq(
    +    test in assembly := {},
    +    assemblyOption in assembly ~= {
    +      _.copy(includeScala = false)
    +    },
    +    assemblyJarName in assembly := {
    +      s"${name.value}_${scalaBinaryVersion.value}-${version.value}.jar"
    +    },
    +    target in assembly := baseDirectory.value / "target" / scalaBinaryVersion.value
    +  )
    +
    +  lazy val aggregated: Seq[ProjectReference] = Seq[ProjectReference](
    +    core,
    +    streaming,
    +    services,
    +    gearpumpHadoop,
    +    packProject
    +  ) ++ examples ++ experiments ++ externals ++ integrationTests
    +
    +  lazy val root = Project(
    +    id = "gearpump",
    +    base = file("."),
    +    settings = commonSettings ++ noPublish ++ gearpumpUnidocSetting,
    +    aggregate = aggregated)
    +    .settings(Defaults.itSettings: _*)
    +    .disablePlugins(sbtassembly.AssemblyPlugin)
    +
    +  lazy val core = Project(
    +    id = "gearpump-core",
    +    base = file("core"),
    +    settings = commonSettings ++ myAssemblySettings ++ javadocSettings ++ coreDependencies ++
    +      addArtifact(Artifact("gearpump-core"), sbtassembly.AssemblyKeys.assembly) ++ Seq(
    +      assemblyShadeRules in assembly := Seq(
    +        ShadeRule.zap("akka.**").inAll,
    +        ShadeRule.zap("com.google.protobuf.**").inAll,
    +        ShadeRule.zap("com.typesafe.**").inAll,
    +        ShadeRule.zap("net.jpountz.**").inAll,
    +        ShadeRule.zap("org.apache.commons.**").inAll,
    +        ShadeRule.zap("org.apache.log4j.**").inAll,
    +        ShadeRule.zap("org.jboss.**").inAll,
    +        ShadeRule.zap("org.objectweb.**").inAll,
    +        ShadeRule.zap("org.reactivestreams.**").inAll,
    +        ShadeRule.zap("org.slf4j.**").inAll,
    +        ShadeRule.zap("org.uncommons.maths.**").inAll,
    +        ShadeRule.zap("scala.**").inAll,
    +        ShadeRule.zap("spray.**").inAll,
    +        ShadeRule.rename("com.romix.**" -> "org.apache.gearpump.romix.@1").inAll,
    +        ShadeRule.rename("com.esotericsoftware.**" ->
    +          "org.apache.gearpump.esotericsoftware.@1").inAll,
    +        ShadeRule.rename("org.objenesis.**" -> "org.apache.gearpump.objenesis.@1").inAll,
    +        ShadeRule.rename("com.google.**" -> "org.apache.gearpump.google.@1").inAll,
    +        ShadeRule.rename("com.codahale.metrics.**" ->
    +          "org.apache.gearpump.codahale.metrics.@1").inAll
    +      ),
    +
    +      pomPostProcess := {
    +        (node: xml.Node) => changeShadedDeps(
    +          Set(
    +            "com.github.romix.akka",
    +            "com.google.guava",
    +            "com.codahale.metrics",
    +            "org.scala-lang",
    +            "org.scoverage"
    +          ), List.empty[xml.Node], node)
    +      }
    +    ))
    +
    +  lazy val streaming = Project(
    +    id = "gearpump-streaming",
    +    base = file("streaming"),
    +    settings = commonSettings ++ myAssemblySettings ++ javadocSettings ++
    +      addArtifact(Artifact("gearpump-streaming"), sbtassembly.AssemblyKeys.assembly) ++
    +      Seq(
    +        assemblyShadeRules in assembly := Seq(
    +          ShadeRule.rename("com.gs.collections.**" ->
    +            "org.apache.gearpump.gs.collections.@1").inAll
    +        ),
    +
    +        assemblyMergeStrategy in assembly := {
    +          case "geardefault.conf" =>
    +            MergeStrategy.last
    +          case x =>
    +            val oldStrategy = (assemblyMergeStrategy in assembly).value
    +            oldStrategy(x)
    +        },
    +
    +        libraryDependencies ++= Seq(
    +          "com.goldmansachs" % "gs-collections" % gsCollectionsVersion
    +        ),
    +
    +        pomPostProcess := {
    --- End diff --
    
    they are now transitive dependencies and will be added the published pom file


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-gearpump pull request #108: [GEARPUMP-226] refactor build files

Posted by huafengw <gi...@git.apache.org>.
Github user huafengw commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/108#discussion_r86914392
  
    --- Diff: project/BuildGearpump.scala ---
    @@ -0,0 +1,258 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +import com.typesafe.sbt.SbtPgp.autoImport._
    +import BuildExamples.examples
    +import BuildExperiments.experiments
    +import BuildExternals.externals
    +import BuildIntegrationTests.integrationTests
    +import BuildDashboard.services
    +import Dependencies._
    +import Docs._
    +import de.johoop.jacoco4sbt.JacocoPlugin.jacoco
    +import sbt.Keys._
    +import sbt._
    +import Pack.packProject
    +import sbtassembly.AssemblyPlugin.autoImport._
    +
    +import xerial.sbt.Sonatype._
    +
    +object BuildGearpump extends sbt.Build {
    +
    +  val apacheRepo = "https://repository.apache.org/"
    +  val distDirectory = "output"
    +  val projectName = "gearpump"
    +
    +  val commonSettings = Seq(jacoco.settings: _*) ++ sonatypeSettings ++
    +    Seq(
    +      resolvers ++= Seq(
    +        "patriknw at bintray" at "http://dl.bintray.com/patriknw/maven",
    +        "apache-repo" at "https://repository.apache.org/content/repositories",
    +        "maven1-repo" at "http://repo1.maven.org/maven2",
    +        "maven2-repo" at "http://mvnrepository.com/artifact",
    +        "sonatype" at "https://oss.sonatype.org/content/repositories/releases",
    +        "bintray/non" at "http://dl.bintray.com/non/maven",
    +        "clockfly" at "http://dl.bintray.com/clockfly/maven",
    +        "clojars" at "http://clojars.org/repo"
    +      )
    +      // ,addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full)
    +    ) ++
    +    Seq(
    +      scalaVersion := scalaVersionNumber,
    +      crossScalaVersions := crossScalaVersionNumbers,
    +      organization := "org.apache.gearpump",
    +      useGpg := false,
    +      pgpSecretRing := file("./secring.asc"),
    +      pgpPublicRing := file("./pubring.asc"),
    +      scalacOptions ++= Seq("-Yclosure-elim", "-Yinline"),
    +      publishMavenStyle := true,
    +
    +      pgpPassphrase := Option(System.getenv().get("PASSPHRASE")).map(_.toArray),
    +      credentials += Credentials(
    +        "Sonatype Nexus Repository Manager",
    +        "repository.apache.org",
    +        System.getenv().get("SONATYPE_USERNAME"),
    +        System.getenv().get("SONATYPE_PASSWORD")),
    +
    +      pomIncludeRepository := { _ => false },
    +
    +      publishTo := {
    +        if (isSnapshot.value) {
    +          Some("snapshots" at apacheRepo + "content/repositories/snapshots")
    +        } else {
    +          Some("releases" at apacheRepo + "content/repositories/releases")
    +        }
    +      },
    +
    +      publishArtifact in Test := true,
    +
    +      pomExtra := {
    +        <url>https://github.com/apache/incubator-gearpump</url>
    +          <licenses>
    +            <license>
    +              <name>Apache 2</name>
    +              <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    +            </license>
    +          </licenses>
    +          <scm>
    +            <connection>scm:git://git.apache.org/incubator-gearpump.git</connection>
    +            <developerConnection>scm:git:git@github.com:apache/incubator-gearpump</developerConnection>
    +            <url>github.com/apache/incubator-gearpump</url>
    +          </scm>
    +          <developers>
    +            <developer>
    +              <id>gearpump</id>
    +              <name>Gearpump Team</name>
    +              <url>http://gearpump.incubator.apache.org/community.html#who-we-are</url>
    +            </developer>
    +          </developers>
    +      }
    +    )
    +
    +  val noPublish = Seq(
    +    publish := {},
    +    publishLocal := {},
    +    publishArtifact := false,
    +    publishArtifact in Test := false
    +  )
    +
    +
    +
    +  lazy val myAssemblySettings = Seq(
    +    test in assembly := {},
    +    assemblyOption in assembly ~= {
    +      _.copy(includeScala = false)
    +    },
    +    assemblyJarName in assembly := {
    +      s"${name.value}_${scalaBinaryVersion.value}-${version.value}.jar"
    +    },
    +    target in assembly := baseDirectory.value / "target" / scalaBinaryVersion.value
    +  )
    +
    +  lazy val aggregated: Seq[ProjectReference] = Seq[ProjectReference](
    +    core,
    +    streaming,
    +    services,
    +    gearpumpHadoop,
    +    packProject
    +  ) ++ examples ++ experiments ++ externals ++ integrationTests
    +
    +  lazy val root = Project(
    +    id = "gearpump",
    +    base = file("."),
    +    settings = commonSettings ++ noPublish ++ gearpumpUnidocSetting,
    +    aggregate = aggregated)
    +    .settings(Defaults.itSettings: _*)
    +    .disablePlugins(sbtassembly.AssemblyPlugin)
    +
    +  lazy val core = Project(
    +    id = "gearpump-core",
    +    base = file("core"),
    +    settings = commonSettings ++ myAssemblySettings ++ javadocSettings ++ coreDependencies ++
    +      addArtifact(Artifact("gearpump-core"), sbtassembly.AssemblyKeys.assembly) ++ Seq(
    +      assemblyShadeRules in assembly := Seq(
    +        ShadeRule.zap("akka.**").inAll,
    +        ShadeRule.zap("com.google.protobuf.**").inAll,
    +        ShadeRule.zap("com.typesafe.**").inAll,
    +        ShadeRule.zap("net.jpountz.**").inAll,
    +        ShadeRule.zap("org.apache.commons.**").inAll,
    +        ShadeRule.zap("org.apache.log4j.**").inAll,
    +        ShadeRule.zap("org.jboss.**").inAll,
    +        ShadeRule.zap("org.objectweb.**").inAll,
    +        ShadeRule.zap("org.reactivestreams.**").inAll,
    +        ShadeRule.zap("org.slf4j.**").inAll,
    +        ShadeRule.zap("org.uncommons.maths.**").inAll,
    +        ShadeRule.zap("scala.**").inAll,
    +        ShadeRule.zap("spray.**").inAll,
    +        ShadeRule.rename("com.romix.**" -> "org.apache.gearpump.romix.@1").inAll,
    +        ShadeRule.rename("com.esotericsoftware.**" ->
    +          "org.apache.gearpump.esotericsoftware.@1").inAll,
    +        ShadeRule.rename("org.objenesis.**" -> "org.apache.gearpump.objenesis.@1").inAll,
    +        ShadeRule.rename("com.google.**" -> "org.apache.gearpump.google.@1").inAll,
    +        ShadeRule.rename("com.codahale.metrics.**" ->
    +          "org.apache.gearpump.codahale.metrics.@1").inAll
    +      ),
    +
    +      pomPostProcess := {
    +        (node: xml.Node) => changeShadedDeps(
    +          Set(
    +            "com.github.romix.akka",
    +            "com.google.guava",
    +            "com.codahale.metrics",
    +            "org.scala-lang",
    +            "org.scoverage"
    +          ), List.empty[xml.Node], node)
    +      }
    +    ))
    +
    +  lazy val streaming = Project(
    +    id = "gearpump-streaming",
    +    base = file("streaming"),
    +    settings = commonSettings ++ myAssemblySettings ++ javadocSettings ++
    +      addArtifact(Artifact("gearpump-streaming"), sbtassembly.AssemblyKeys.assembly) ++
    +      Seq(
    +        assemblyShadeRules in assembly := Seq(
    +          ShadeRule.rename("com.gs.collections.**" ->
    +            "org.apache.gearpump.gs.collections.@1").inAll
    +        ),
    +
    +        assemblyMergeStrategy in assembly := {
    +          case "geardefault.conf" =>
    +            MergeStrategy.last
    +          case x =>
    +            val oldStrategy = (assemblyMergeStrategy in assembly).value
    +            oldStrategy(x)
    +        },
    +
    +        libraryDependencies ++= Seq(
    +          "com.goldmansachs" % "gs-collections" % gsCollectionsVersion
    +        ),
    +
    +        pomPostProcess := {
    --- End diff --
    
    do we need post pom process any more?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---