Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 2f3b80a

Browse files
committed
Add declarative widgets jar to release
(c) Copyright IBM Corp. 2016
1 parent a3db75f commit 2f3b80a

File tree

6 files changed

+80
-2
lines changed

6 files changed

+80
-2
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ addons:
2222
hosts:
2323
- declarativewidgets.org
2424

25+
before_install:
26+
openssl aes-256-cbc -K $encrypted_9067f25a9380_key -iv $encrypted_9067f25a9380_iv -in etc/.gpg/secring.gpg.enc -out etc/.gpg/secring.gpg -d
27+
2528
before_script:
2629
- curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
2730
- sh -e /etc/init.d/xvfb start

Makefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
.PHONY: help init clean clean-dist clean-watch clean-watch-docs dist sdist docs
55
.PHONY: dev dev_image dev_image_4.2 _dev _dev-python2 _dev-python3
6-
.PHONY: server server_4.2 remove-server install install-all all release
6+
.PHONY: server server_4.2 remove-server install install-all all release publish-scala-jar
77
.PHONY: start-selenium stop-selenium _run _run-python3 _run-python2 run-test
88
.PHONY: test testdev test-js test-js-remote test-py test-py-all _test-py
99
.PHONY: _test-py-python2 _test-py-python3 test-scala test-r
@@ -199,6 +199,7 @@ else
199199
@docker $(DOCKER_OPTS) run -it --rm \
200200
-v `pwd`:/src \
201201
-v `pwd`/etc/ivy:/root/.ivy2 \
202+
-v `pwd`/etc/sbt_plugin_config:/root/.sbt/0.13/plugins \
202203
$(SCALA_BUILD_REPO) bash -c 'cp -r /src/kernel-scala/* /app/. && \
203204
sbt --warn package && \
204205
cp target/scala-2.10/declarativewidgets*.jar /src/dist/declarativewidgets/static/declarativewidgets.jar && \
@@ -307,6 +308,7 @@ else
307308
@docker $(DOCKER_OPTS) run -it --rm \
308309
-v `pwd`/kernel-scala:/src \
309310
-v `pwd`/etc/ivy:/root/.ivy2 \
311+
-v `pwd`/etc/sbt_plugin_config:/root/.sbt/0.13/plugins \
310312
$(SCALA_BUILD_REPO) bash -c 'cp -r /src/* /app/. && \
311313
sbt --warn test'
312314
endif
@@ -481,7 +483,20 @@ docs: .watch-docs dist/docs
481483

482484
all: init test-js-remote test-py-all test-scala test-r sdist install-all system-test
483485

486+
publish-scala-jar:
487+
@echo 'Publishing scala jar'
488+
@docker $(DOCKER_OPTS) run -it --rm \
489+
-v `pwd`/kernel-scala:/src \
490+
-v `pwd`/etc/.gpg:/root/.gpg \
491+
-v `pwd`/etc/ivy:/root/.ivy2 \
492+
-v `pwd`/etc/sbt_plugin_config:/root/.sbt/0.13/plugins \
493+
-e REPO_USERNAME=$(REPO_USERNAME) \
494+
-e REPO_PASSWORD=$(REPO_PASSWORD) \
495+
-e PGP_PASSPHRASE=$(PGP_PASSPHRASE) \
496+
$(SCALA_BUILD_REPO) bash -c 'cp -r /src/* /app/. && \
497+
sbt publishSigned && sbt sonatypeRelease'
498+
484499
release: EXTRA_OPTIONS=-e PYPI_USER=$(PYPI_USER) -e PYPI_PASSWORD=$(PYPI_PASSWORD)
485500
release: PRE_SDIST=echo "[server-login]" > ~/.pypirc; echo "username:" ${PYPI_USER} >> ~/.pypirc; echo "password:" ${PYPI_PASSWORD} >> ~/.pypirc;
486501
release: POST_SDIST=register upload
487-
release: sdist
502+
release: sdist publish-scala-jar

etc/.gpg/secring.gpg.enc

2.53 KB
Binary file not shown.

etc/docs/site/usage-docs/Basic-Usage.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ declwidgets.init()
2626
##### Scala Initialization
2727

2828
```
29+
//add the declarative widgets jar/dependency via one of the %addjar or %AddDeps magics
30+
2931
// modify to IP and Port of this notebook server
3032
%addjar http://localhost:8888/nbextensions/declarativewidgets/declarativewidgets.jar
3133
34+
// modify the GroupId, ArtifactId, Latest Version for the applicable release
35+
// release versions can be found on http://search.maven.org/#search|ga|1|g:"org.jupyter"
36+
%AddDeps org.jupyter declarativewidgets_2.10 0.6.1_dev --transitive --trace --verbose
37+
3238
import declarativewidgets._
3339
3440
initWidgets

etc/sbt_plugin_config/gpg.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
2+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")

kernel-scala/build.sbt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
* Copyright (c) Jupyter Development Team.
33
* Distributed under the terms of the Modified BSD License.
44
*/
5+
6+
import scala.util.Properties
7+
8+
organization := "org.jupyter"
9+
510
name := "declarativewidgets"
611

712
version := "0.1-SNAPSHOT"
@@ -28,3 +33,50 @@ libraryDependencies ++= Seq(
2833
ivyLoggingLevel in ThisBuild := UpdateLogging.Quiet
2934

3035
parallelExecution in Test := false
36+
37+
publishMavenStyle := true
38+
39+
publishTo := {
40+
val nexus = "https://oss.sonatype.org/"
41+
if (isSnapshot.value)
42+
Some("snapshots" at nexus + "content/repositories/snapshots")
43+
else
44+
Some("releases" at nexus + "service/local/staging/deploy/maven2")
45+
}
46+
47+
publishArtifact in Test := false
48+
49+
pomIncludeRepository := { _ => false }
50+
51+
pomExtra := (
52+
<url>https://github.com/jupyter-incubator/declarativewidgets</url>
53+
<licenses>
54+
<license>
55+
<name>BSD-style</name>
56+
<url>http://www.opensource.org/licenses/bsd-license.php</url>
57+
<distribution>repo</distribution>
58+
</license>
59+
</licenses>
60+
<scm>
61+
<url>git@github.com:jupyter-incubator/declarativewidgets.git</url>
62+
<connection>scm:git:git@github.com:jupyter-incubator/declarativewidgets.git</connection>
63+
</scm>
64+
<developers>
65+
<developer>
66+
<id>dwidgets</id>
67+
<name>declarative widgets</name>
68+
<url>https://github.com/jupyter-incubator/declarativewidgets/graphs/contributors</url>
69+
</developer>
70+
</developers>)
71+
72+
val repoUsername = Properties.envOrElse("REPO_USERNAME", "")
73+
val repoPassword = Properties.envOrElse("REPO_PASSWORD", "")
74+
75+
pgpPassphrase := Some(Properties.envOrElse("PGP_PASSPHRASE", "").toCharArray)
76+
77+
pgpSecretRing := file("/root/.gpg/secring.gpg")
78+
79+
credentials += Credentials("Sonatype Nexus Repository Manager",
80+
"oss.sonatype.org",
81+
repoUsername,
82+
repoPassword)

0 commit comments

Comments
 (0)