Skip to content

@Friend annotation #1286

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

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
import java.io.FileNotFoundException
import java.net.URL

/**
Expand All @@ -52,21 +53,21 @@ open class CheckVersionIncrement : DefaultTask() {
val artifact = "${project.artifactPath()}/${MavenMetadata.FILE_NAME}"
val repoUrl = repository.releases
val metadata = fetch(repoUrl, artifact)
val versions = metadata.versioning.versions
val versionExists = versions.contains(version)
val versions = metadata?.versioning?.versions
val versionExists = versions?.contains(version) ?: false
if (versionExists) {
throw GradleException("""
Version `$version` is already published to maven repository `$repoUrl`.
Try incrementing the library version.
All available versions are: ${versions.joinToString(separator = ", ")}.
All available versions are: ${versions?.joinToString(separator = ", ")}.

To disable this check, run Gradle with `-x $name`.
""".trimIndent()
)
}
}

private fun fetch(repository: String, artifact: String): MavenMetadata {
private fun fetch(repository: String, artifact: String): MavenMetadata? {
val url = URL("$repository/$artifact")
return MavenMetadata.fetchAndParse(url)
}
Expand Down Expand Up @@ -94,9 +95,19 @@ private data class MavenMetadata(var versioning: Versioning = Versioning()) {
mapper.configure(FAIL_ON_UNKNOWN_PROPERTIES, false)
}

fun fetchAndParse(url: URL): MavenMetadata {
val metadata = mapper.readValue(url, MavenMetadata::class.java)
return metadata
/**
* Fetches the metadata for the repository and parses the document.
*
* <p>If the document could not be found, assumes that the module was never
* released and thus has no metadata.
*/
fun fetchAndParse(url: URL): MavenMetadata? {
return try {
val metadata = mapper.readValue(url, MavenMetadata::class.java)
metadata
} catch (e: FileNotFoundException) {
null
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/io/spine/gradle/internal/deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ object Versions {
val javaPoet = "1.12.1"
val autoService = "1.0-rc6"
val autoCommon = "0.10"
val jackson = "2.9.10.4"
val jackson = "2.9.10.5"
val animalSniffer = "1.18"
val apiguardian = "1.1.0"
val javaxAnnotation = "1.3.2"
Expand Down
9 changes: 5 additions & 4 deletions core/src/main/java/io/spine/core/BoundedContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
package io.spine.core;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.PACKAGE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Marks a package as one belonging to a Bounded Context with
* the {@linkplain #value() specified name}.
Expand All @@ -49,8 +50,8 @@
* <p>Packages that do not have a common “parent” but annotated with the same name belong
* to the same Bounded Context.
*/
@Target(ElementType.PACKAGE)
@Retention(RetentionPolicy.RUNTIME)
@Target(PACKAGE)
@Retention(RUNTIME)
@Documented
public @interface BoundedContext {

Expand Down
43 changes: 27 additions & 16 deletions license-report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


# Dependencies of `io.spine:spine-client:1.5.20`
# Dependencies of `io.spine:spine-client:2.0.0-alfa-001`

## Runtime
1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4
Expand Down Expand Up @@ -324,6 +324,7 @@
1. **Group:** org.jacoco **Name:** org.jacoco.report **Version:** 0.8.5
* **POM License: Eclipse Public License 2.0** - [https://www.eclipse.org/legal/epl-2.0/](https://www.eclipse.org/legal/epl-2.0/)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -405,12 +406,12 @@
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.


This report was generated on **Fri Jun 19 14:07:39 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
This report was generated on **Fri Aug 07 17:07:07 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-core:1.5.20`
# Dependencies of `io.spine:spine-core:2.0.0-alfa-001`

## Runtime
1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2
Expand Down Expand Up @@ -694,6 +695,7 @@ This report was generated on **Fri Jun 19 14:07:39 EEST 2020** using [Gradle-Lic
1. **Group:** org.jacoco **Name:** org.jacoco.report **Version:** 0.8.5
* **POM License: Eclipse Public License 2.0** - [https://www.eclipse.org/legal/epl-2.0/](https://www.eclipse.org/legal/epl-2.0/)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -775,12 +777,12 @@ This report was generated on **Fri Jun 19 14:07:39 EEST 2020** using [Gradle-Lic
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.


This report was generated on **Fri Jun 19 14:07:40 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
This report was generated on **Fri Aug 07 17:07:07 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine.tools:spine-model-assembler:1.5.20`
# Dependencies of `io.spine.tools:spine-model-assembler:2.0.0-alfa-001`

## Runtime
1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4
Expand Down Expand Up @@ -1099,6 +1101,7 @@ This report was generated on **Fri Jun 19 14:07:40 EEST 2020** using [Gradle-Lic
1. **Group:** org.jacoco **Name:** org.jacoco.report **Version:** 0.8.5
* **POM License: Eclipse Public License 2.0** - [https://www.eclipse.org/legal/epl-2.0/](https://www.eclipse.org/legal/epl-2.0/)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -1180,12 +1183,12 @@ This report was generated on **Fri Jun 19 14:07:40 EEST 2020** using [Gradle-Lic
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.


This report was generated on **Fri Jun 19 14:07:40 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
This report was generated on **Fri Aug 07 17:07:08 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine.tools:spine-model-verifier:1.5.20`
# Dependencies of `io.spine.tools:spine-model-verifier:2.0.0-alfa-001`

## Runtime
1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4
Expand Down Expand Up @@ -1570,6 +1573,7 @@ This report was generated on **Fri Jun 19 14:07:40 EEST 2020** using [Gradle-Lic
* **POM License: Eclipse Public License version 1.0** - [http://www.eclipse.org/legal/epl-v10.html](http://www.eclipse.org/legal/epl-v10.html)
* **POM License: Public Domain** - [http://repository.jboss.org/licenses/cc0-1.0.txt](http://repository.jboss.org/licenses/cc0-1.0.txt)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit-pioneer **Name:** junit-pioneer **Version:** 0.4.2
* **POM Project URL:** [https://github.com/junit-pioneer/junit-pioneer](https://github.com/junit-pioneer/junit-pioneer)
* **POM License: The MIT License** - [https://github.com/junit-pioneer/junit-pioneer/blob/master/LICENSE](https://github.com/junit-pioneer/junit-pioneer/blob/master/LICENSE)
Expand Down Expand Up @@ -1655,12 +1659,12 @@ This report was generated on **Fri Jun 19 14:07:40 EEST 2020** using [Gradle-Lic
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.


This report was generated on **Fri Jun 19 14:07:41 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
This report was generated on **Fri Aug 07 17:07:11 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-server:1.5.20`
# Dependencies of `io.spine:spine-server:2.0.0-alfa-001`

## Runtime
1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4
Expand Down Expand Up @@ -1996,6 +2000,7 @@ This report was generated on **Fri Jun 19 14:07:41 EEST 2020** using [Gradle-Lic
1. **Group:** org.jacoco **Name:** org.jacoco.report **Version:** 0.8.5
* **POM License: Eclipse Public License 2.0** - [https://www.eclipse.org/legal/epl-2.0/](https://www.eclipse.org/legal/epl-2.0/)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -2077,12 +2082,12 @@ This report was generated on **Fri Jun 19 14:07:41 EEST 2020** using [Gradle-Lic
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.


This report was generated on **Fri Jun 19 14:07:42 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
This report was generated on **Fri Aug 07 17:07:14 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-testutil-client:1.5.20`
# Dependencies of `io.spine:spine-testutil-client:2.0.0-alfa-001`

## Runtime
1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4
Expand Down Expand Up @@ -2215,6 +2220,7 @@ This report was generated on **Fri Jun 19 14:07:42 EEST 2020** using [Gradle-Lic
1. **Group:** org.hamcrest **Name:** hamcrest-core **Version:** 1.3
* **POM License: New BSD License** - [http://www.opensource.org/licenses/bsd-license.php](http://www.opensource.org/licenses/bsd-license.php)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -2454,6 +2460,7 @@ This report was generated on **Fri Jun 19 14:07:42 EEST 2020** using [Gradle-Lic
1. **Group:** org.jacoco **Name:** org.jacoco.report **Version:** 0.8.5
* **POM License: Eclipse Public License 2.0** - [https://www.eclipse.org/legal/epl-2.0/](https://www.eclipse.org/legal/epl-2.0/)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -2535,12 +2542,12 @@ This report was generated on **Fri Jun 19 14:07:42 EEST 2020** using [Gradle-Lic
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.


This report was generated on **Fri Jun 19 14:07:44 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
This report was generated on **Fri Aug 07 17:07:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-testutil-core:1.5.20`
# Dependencies of `io.spine:spine-testutil-core:2.0.0-alfa-001`

## Runtime
1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4
Expand Down Expand Up @@ -2673,6 +2680,7 @@ This report was generated on **Fri Jun 19 14:07:44 EEST 2020** using [Gradle-Lic
1. **Group:** org.hamcrest **Name:** hamcrest-core **Version:** 1.3
* **POM License: New BSD License** - [http://www.opensource.org/licenses/bsd-license.php](http://www.opensource.org/licenses/bsd-license.php)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -2920,6 +2928,7 @@ This report was generated on **Fri Jun 19 14:07:44 EEST 2020** using [Gradle-Lic
1. **Group:** org.jacoco **Name:** org.jacoco.report **Version:** 0.8.5
* **POM License: Eclipse Public License 2.0** - [https://www.eclipse.org/legal/epl-2.0/](https://www.eclipse.org/legal/epl-2.0/)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -3001,12 +3010,12 @@ This report was generated on **Fri Jun 19 14:07:44 EEST 2020** using [Gradle-Lic
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.


This report was generated on **Fri Jun 19 14:07:45 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
This report was generated on **Fri Aug 07 17:07:16 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-testutil-server:1.5.20`
# Dependencies of `io.spine:spine-testutil-server:2.0.0-alfa-001`

## Runtime
1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4
Expand Down Expand Up @@ -3139,6 +3148,7 @@ This report was generated on **Fri Jun 19 14:07:45 EEST 2020** using [Gradle-Lic
1. **Group:** org.hamcrest **Name:** hamcrest-core **Version:** 1.3
* **POM License: New BSD License** - [http://www.opensource.org/licenses/bsd-license.php](http://www.opensource.org/licenses/bsd-license.php)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -3422,6 +3432,7 @@ This report was generated on **Fri Jun 19 14:07:45 EEST 2020** using [Gradle-Lic
1. **Group:** org.jacoco **Name:** org.jacoco.report **Version:** 0.8.5
* **POM License: Eclipse Public License 2.0** - [https://www.eclipse.org/legal/epl-2.0/](https://www.eclipse.org/legal/epl-2.0/)

1. **Group:** org.junit **Name:** junit-bom **Version:** 5.6.2 **No license information found**
1. **Group:** org.junit.jupiter **Name:** junit-jupiter-api **Version:** 5.6.2
* **POM Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/)
* **POM License: Eclipse Public License v2.0** - [https://www.eclipse.org/legal/epl-v20.html](https://www.eclipse.org/legal/epl-v20.html)
Expand Down Expand Up @@ -3503,4 +3514,4 @@ This report was generated on **Fri Jun 19 14:07:45 EEST 2020** using [Gradle-Lic
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.


This report was generated on **Fri Jun 19 14:07:48 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
This report was generated on **Fri Aug 07 17:07:21 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
Loading