-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a
repository
directive (#575)
- Loading branch information
Showing
7 changed files
with
270 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pullRequests.frequency = "@monthly" | ||
|
||
commits.message = "bump: ${artifactName} ${nextVersion} (was ${currentVersion})" |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Releasing | ||
|
||
1. Wait until all running [Travis CI jobs](https://travis-ci.com/github/lightbend/paradox/builds) complete, if any. | ||
1. Wait until all running [GitHub Continuous Integration workflow](https://github.com/lightbend/paradox/actions/workflows/ci.yml) is complete, if any. | ||
1. Publish the [draft release](https://github.com/lightbend/paradox/releases) with a 'v0.x.y' tag | ||
1. Travis CI will start a [CI build](https://travis-ci.org/lightbend/paradox/builds) for the new tag and publish artifacts to Bintray and Sonatype. | ||
1. Have someone bake the release... | ||
1. Announce the new release in the [lightbend/paradox](https://gitter.im/lightbend/paradox) Gitter channel. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Library repositories | ||
-------------------- | ||
|
||
The `@@repository` block is used to show example code for how to configure a | ||
library repository in a build tool, such as sbt. | ||
|
||
```markdown | ||
@@repository[sbt,Maven,Gradle] { | ||
id="company-repo" | ||
name="Company repository" | ||
url="http://jars.acme.com" | ||
} | ||
``` | ||
|
||
Which will render as: | ||
|
||
@@repository[sbt,Maven,Gradle] { | ||
id="company-repo" | ||
name="Company repository" | ||
url="http://jars.acme.com" | ||
} |
141 changes: 141 additions & 0 deletions
141
tests/src/test/scala/com/lightbend/paradox/markdown/RepositoryDirectiveSpec.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,141 @@ | ||
/* | ||
* Copyright © 2015 - 2019 Lightbend, Inc. <http://www.lightbend.com> | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
package com.lightbend.paradox.markdown | ||
|
||
import com.lightbend.paradox.tree.Tree.Location | ||
|
||
class RepositoryDirectiveSpec extends MarkdownBaseSpec { | ||
|
||
val testProperties = Map( | ||
"project.version" -> "10.0.10", | ||
"scala.version" -> "2.12.3", | ||
"scala.binary.version" -> "2.12" | ||
) | ||
|
||
implicit val context: Location[Page] => Writer.Context = { loc => | ||
writerContext(loc).copy(properties = testProperties) | ||
} | ||
|
||
"Repository directive" should "render single repo" in { | ||
markdown(""" | ||
|@@repository[sbt,Maven,gradle] { | ||
| id="id1" | ||
| name="Company repository" | ||
| url="http://jars.acme.com" | ||
|}""") shouldEqual html(s""" | ||
|<dl class="repository"> | ||
|<dt>sbt</dt> | ||
|<dd> | ||
|<pre class="prettyprint"> | ||
|<code class="language-scala"> | ||
|repositories += "Company repository".at("http://jars.acme.com") | ||
|</code> | ||
|</pre> | ||
|</dd> | ||
|<dt>Maven</dt> | ||
|<dd> | ||
|<pre class="prettyprint"> | ||
|<code class="language-xml"> | ||
|<project> | ||
| ... | ||
| <repositories> | ||
| <repository> | ||
| <id>id1</id> | ||
| <name>Company repository</name> | ||
| <url>http://jars.acme.com</url> | ||
| </repository> | ||
| </repositories> | ||
|</project> | ||
|</code></pre> | ||
|</dd> | ||
|<dt>gradle</dt> | ||
|<dd> | ||
|<pre class="prettyprint"> | ||
|<code class="language-gradle"> | ||
|repositories { | ||
| mavenCentral() | ||
| maven { | ||
| url "http://jars.acme.com" | ||
| } | ||
|} | ||
|</code></pre> | ||
|</dd> | ||
|</dl>""") | ||
} | ||
|
||
"Repository directive" should "render two repos" in { | ||
markdown(""" | ||
|@@repository[sbt,Maven,gradle] { | ||
| id1="id1" | ||
| name1="Company repository" | ||
| url1="http://jars.acme.com" | ||
| id2="id-2" | ||
| name2="Company repository 2" | ||
| url2="http://uberjars.acme.com" | ||
|}""") shouldEqual html(s""" | ||
|<dl class="repository"> | ||
|<dt>sbt</dt> | ||
|<dd> | ||
|<pre class="prettyprint"> | ||
|<code class="language-scala"> | ||
|repositories ++= Seq( | ||
| "Company repository".at("http://jars.acme.com"), | ||
| "Company repository 2".at("http://uberjars.acme.com") | ||
|) | ||
|</code> | ||
|</pre> | ||
|</dd> | ||
|<dt>Maven</dt> | ||
|<dd> | ||
|<pre class="prettyprint"> | ||
|<code class="language-xml"> | ||
|<project> | ||
| ... | ||
| <repositories> | ||
| <repository> | ||
| <id>id1</id> | ||
| <name>Company repository</name> | ||
| <url>http://jars.acme.com</url> | ||
| </repository> | ||
| <repository> | ||
| <id>id-2</id> | ||
| <name>Company repository 2</name> | ||
| <url>http://uberjars.acme.com</url> | ||
| </repository> | ||
| </repositories> | ||
|</project> | ||
|</code></pre> | ||
|</dd> | ||
|<dt>gradle</dt> | ||
|<dd> | ||
|<pre class="prettyprint"> | ||
|<code class="language-gradle"> | ||
|repositories { | ||
| mavenCentral() | ||
| maven { | ||
| url "http://jars.acme.com" | ||
| } | ||
| maven { | ||
| url "http://uberjars.acme.com" | ||
| } | ||
|} | ||
|</code></pre> | ||
|</dd> | ||
|</dl>""") | ||
} | ||
|
||
} |