New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework build to allow publishing core to maven #3069
Conversation
It tended too easily to get out of synch with build.xml.
Publish to maven with `ant publish.local`, `ant publish`, or `ant publish.signed`. For now, we must keep copying `src/build/maven/maven-deploy.xml` to `dists/maven/latest.build.xml`, along with its dependencies, as it's used by jenkins jobs and PR validation. TODO: `inline src/build/maven/maven-deploy.xml` into `build.xml`.
Use `unless` attribute in targets so that `docs.skip` influences dependency graph. Create `scaladoc` task in `pack.core` so that we don't need `pack.done` for publishing the core. Move source bundle creation from `dist.src` to `osgi.core`/`osgi.done`. Split dependencies of maven publishing into core/all variants: `osgi.core` creates osgi bundles for just lib/reflect/comp.
`ant publish-core-signed-opt-nodocs` creates and publishes the smallest possible set of jars (library/reflect/compiler) we can send to maven. It uploads jars with class files and sources, but no docs (so that we don't need to build scaladoc or any other modules). `ant publish-core-signed-opt` is similar, but also publishes docs. For local experimentation: `ant publish-core-local-nodocs`. With a little bit more work, this can be used instead of `replacestarr`.
Perhaps you could trigger a few builds that aren't part of the PR validation and link the results here, e.g.
|
I just tried this, and the But, the overall build claimed to be successful.
|
diff --git a/src/build/maven/maven-deploy.xml b/src/build/maven/maven-deploy.xml
index 90bfaa4..9e4215d 100644
--- a/src/build/maven/maven-deploy.xml
+++ b/src/build/maven/maven-deploy.xml
@@ -63,7 +63,7 @@
</then><else>
<property name="repo" value="${local.repository}"/>
</else></if>
- <artifact:mvn>
+ <artifact:mvn failonerror="true">
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<arg value="-Durl=${repo}" />
<arg value="-DrepositoryId=${repository.credentials.id}" /> |
Incidentally, the certificate problem could be resolved on my machine with:
That gives, as expected, a 401 uploading the new snapshot to Sonatype.
|
For the record, here's the diff to maven-deploy, modulo moving stuff around. diff --git 1/var/folders/xk/z9mv3_2d68l15z0lnqcnsgs40000gn/T/partXXX.k3PJVdGv 2/var/folders/xk/z9mv3_2d68l15z0lnqcnsgs40000gn/T/partXXX.k3PJVdGv2
index 8860897e55..1d3bf1e85c 100644
--- 1/var/folders/xk/z9mv3_2d68l15z0lnqcnsgs40000gn/T/partXXX.k3PJVdGv
+++ 2/var/folders/xk/z9mv3_2d68l15z0lnqcnsgs40000gn/T/partXXX.k3PJVdGv2
@@ -1,8 +1,9 @@
<macrodef name="deploy-one">
<attribute name="dir" default=""/>
<attribute name="name" />
- <attribute name="local" default="false"/>
- <attribute name="signed" default="false"/>
+ <attribute name="version" />
+ <attribute name="local" />
+ <attribute name="signed" />
<sequential>
<local name="path"/> <property name="path" value="@{dir}@{name}/@{name}"/>
@@ -11,7 +12,7 @@
<copy file="${path}-pom.xml" tofile="${path}-pom-filtered.xml" overwrite="true">
<filterset>
- <filter token="VERSION" value="${maven.version.number}" />
+ <filter token="VERSION" value="@{version}" />
<filter token="SCALA_BINARY_VERSION" value="${scala.binary.version}" />
<filter token="XML_VERSION" value="${scala-xml.version.number}" />
<filter token="PARSER_COMBINATORS_VERSION" value="${scala-parser-combinators.version.number}" />
@@ -43,7 +44,6 @@
<artifact:localRepository path="${local.repository}" id="${repository.credentials.id}" />
<artifact:pom refid="@{name}.pom" />
<artifact:attach type="jar" file="${path}-src.jar" classifier="sources" />
- <artifact:attach type="jar" file="${path}-docs.jar" classifier="javadoc" />
</artifact:install>
</else>
</if>
@@ -71,17 +71,16 @@
</macrodef>
<macrodef name="deploy">
- <attribute name="dir" default=""/>
<attribute name="local" default="false"/>
<attribute name="signed" default="false"/>
<sequential>
- <deploy-one dir="@{dir}" name="scala-library" local="@{local}" signed="@{signed}"/>
- <deploy-one dir="@{dir}" name="scala-reflect" local="@{local}" signed="@{signed}"/>
- <deploy-one dir="@{dir}" name="scala-compiler" local="@{local}" signed="@{signed}"/>
- <deploy-one dir="@{dir}" name="scala-actors" local="@{local}" signed="@{signed}"/>
- <deploy-one dir="@{dir}" name="scala-swing" local="@{local}" signed="@{signed}"/>
- <deploy-one dir="@{dir}" name="scalap" local="@{local}" signed="@{signed}"/>
- <deploy-one dir="@{dir}plugins/" name="continuations" local="@{local}" signed="@{signed}"/>
+ <deploy-one name="scala-actors" version="${maven.version.number}" local="@{local}" signed="@{signed}"/>
+ <deploy-one name="scala-compiler" version="${maven.version.number}" local="@{local}" signed="@{signed}"/>
+ <deploy-one name="scala-library" version="${maven.version.number}" local="@{local}" signed="@{signed}"/>
+ <deploy-one name="scala-reflect" version="${maven.version.number}" local="@{local}" signed="@{signed}"/>
+ <deploy-one name="scala-swing" version="${maven.version.number}" local="@{local}" signed="@{signed}"/>
+ <deploy-one name="scalap" version="${maven.version.number}" local="@{local}" signed="@{signed}"/>
+ <deploy-one dir="plugins/" name="continuations" version="${maven.version.number}" local="@{local}" signed="@{signed}"/>
</sequential>
</macrodef> |
Fix oversight in not skipping scalap's ad-hoc published docs on docs.skip.
LGTM. Is |
@retronym I expect it can go. |
Rework build to allow publishing core to maven
ant publish-core-signed-opt-nodocs
creates and publishes the smallestpossible set of jars (library/reflect/compiler) we can send to maven.
It uploads jars with class files and sources, but no docs
(so that we don't need to build scaladoc or any other modules).
ant publish-core-signed-opt
is similar, but also publishes docs.For local experimentation:
ant publish-core-local-nodocs
.With a little bit more work, this can be used instead of
replacestarr
.This should allow breaking cycles in a principled way in dbuild:
Building the core doesn't have any dependencies on the new modules (it's similar to locker.done).
(Don't test --> no need for partest, skip docs -> ignore soon-to-be-module scaladoc.)
The next step is to build and publish a modularized scaladoc in this build,
and support using a maven-resolved scaladoc to generate docs.
Review by everyone: @gkossakowski, @retronym, @cunei, @jsuereth, @xeno-by, @paulp.