Skip to content

Commit

Permalink
Upgrade to Java 17 and Gradle 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Jun 25, 2022
1 parent 8e677dc commit 5d5dccf
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 195 deletions.
124 changes: 33 additions & 91 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
task wrapper(type: Wrapper) {
gradleVersion = '4.0'
}

defaultTasks 'clean', 'compileJava', 'test'

subprojects { proj ->

apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'maven'
apply plugin: 'signing'

description = 'Structurizr'
Expand All @@ -18,7 +12,6 @@ subprojects { proj ->

repositories {
mavenCentral()
mavenLocal()
}

sourceSets {
Expand All @@ -34,125 +27,74 @@ subprojects { proj ->
}
}

dependencies {
compile 'com.google.code.findbugs:jsr305:3.0.2'
}

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'

sourceCompatibility = 1.8
targetCompatibility = 1.8

java {
withJavadocJar()
withSourcesJar()
}

jar {
manifest {
attributes(
"Implementation-Title": "Structurizr for Java",
"Implementation-Version": version
"Implementation-Title": "Structurizr for Java",
"Implementation-Version": version
)
}
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

artifacts {
archives javadocJar, sourcesJar
}

signing {
sign configurations.archives
}

uploadArchives {
publishing {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
maven {
name = "ossrh"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = findProperty('ossrhUsername')
password = findProperty('ossrhPassword')
}
}
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
publications {
mavenJava(MavenPublication) {
from components.java

pom.project {
name 'Structurizr for Java'
packaging 'jar'
description 'Structurizr for Java'
url 'https://github.com/structurizr/java'
pom {
name = 'Structurizr for Java'
description = 'Structurizr for Java'
url = 'https://github.com/structurizr/java'

scm {
connection 'scm:git:git://github.com/structurizr/structurizr-java.git'
developerConnection 'scm:git:[email protected]:structurizr/structurizr-java.git'
url 'https://github.com/structurizr/java'
connection = 'scm:git:git://github.com/structurizr/structurizr-java.git'
developerConnection = 'scm:git:[email protected]:structurizr/structurizr-java.git'
url = 'https://github.com/structurizr/java'
}

licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id "simon"
name "Simon Brown"
email "[email protected]"
id = "simon"
name = "Simon Brown"
email = "[email protected]"
}
}
}
}
}
}

def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "simon"
name "Simon Brown"
email "[email protected]"
}
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', 'Visualise, document and explore your software architecture with the C4 model.')
root.appendNode('name', 'Structurizr for Java')
root.appendNode('url', 'https://github.com/structurizr/java')
root.children().last() + pomConfig
}
}
}

repositories {
maven {
url "$buildDir/repo"
}
}
signing {
sign publishing.publications.mavenJava
}

}
14 changes: 0 additions & 14 deletions gradle/gradle.iml

This file was deleted.

3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Nov 19 10:27:00 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
26 changes: 7 additions & 19 deletions structurizr-client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
dependencies {

compile project(':structurizr-core')
implementation project(':structurizr-core')

compile 'com.fasterxml.jackson.core:jackson-databind:2.13.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.3'

compile 'org.apache.httpcomponents.client5:httpclient5:5.1.3'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.1.3'

compile 'javax.xml.bind:jaxb-api:2.3.0'
implementation 'javax.xml.bind:jaxb-api:2.3.0'

testCompile 'junit:junit:4.12'
}
implementation 'commons-logging:commons-logging:1.2'

sourceSets {
main {
java {
srcDir 'src'
}
}
test {
java {
srcDir 'test/unit'
srcDir 'test/integration'
}
}
}
testImplementation 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ public void test_findElementStyle_WithThemes() {
workspace.getViews().getConfiguration().getStyles().addStylesFromTheme("url2", elementStyles, relationshipStyles);

ElementStyle style = workspace.getViews().getConfiguration().getStyles().findElementStyle(softwareSystem);
assertEquals(new Integer(450), style.getWidth());
assertEquals(new Integer(300), style.getHeight());
assertEquals(Integer.valueOf(450), style.getWidth());
assertEquals(Integer.valueOf(300), style.getHeight());
assertEquals("#ff0000", style.getBackground()); // from theme 2
assertEquals("#ffffff", style.getColor()); // from theme 1
assertEquals(new Integer(24), style.getFontSize());
assertEquals(Integer.valueOf(24), style.getFontSize());
assertEquals(Shape.RoundedBox, style.getShape()); // from workspace
assertNull(style.getIcon());
assertEquals(Border.Solid, style.getBorder());
assertEquals("#b20000", style.getStroke());
assertEquals(new Integer(100), style.getOpacity());
assertEquals(Integer.valueOf(100), style.getOpacity());
assertEquals(true, style.getMetadata());
assertEquals(true, style.getDescription());
}
Expand All @@ -120,14 +120,14 @@ public void test_findRelationshipStyle_WithThemes() {
workspace.getViews().getConfiguration().getStyles().addStylesFromTheme("url2", elementStyles, relationshipStyles);

RelationshipStyle style = workspace.getViews().getConfiguration().getStyles().findRelationshipStyle(relationship);
assertEquals(new Integer(4), style.getThickness()); // from theme 1
assertEquals(Integer.valueOf(4), style.getThickness()); // from theme 1
assertEquals("#0000ff", style.getColor()); // from theme 2
Assert.assertFalse(style.getDashed()); // from workspace
assertEquals(Routing.Direct, style.getRouting());
assertEquals(new Integer(24), style.getFontSize());
assertEquals(new Integer(200), style.getWidth());
assertEquals(new Integer(50), style.getPosition());
assertEquals(new Integer(100), style.getOpacity());
assertEquals(Integer.valueOf(24), style.getFontSize());
assertEquals(Integer.valueOf(200), style.getWidth());
assertEquals(Integer.valueOf(50), style.getPosition());
assertEquals(Integer.valueOf(100), style.getOpacity());
}

}
24 changes: 6 additions & 18 deletions structurizr-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
dependencies {

compile 'com.fasterxml.jackson.core:jackson-annotations:2.13.3'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.3'
implementation 'com.google.code.findbugs:jsr305:3.0.2'

compile 'commons-logging:commons-logging:1.2'
implementation 'commons-logging:commons-logging:1.2'

testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:3.9.1'
}

sourceSets {
main {
java {
srcDir 'src'
}
}
test {
java {
srcDir 'test/unit'
}
}
}
testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.9.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ public void test_setPosition_SetsPositionToNull_WhenNullIsSpecified() {
@Test
public void test_setPosition_SetsPositionToZero_WhenANegativeNumberIsSpecified() {
relationshipStyle.setPosition(-1);
assertEquals(new Integer(0), relationshipStyle.getPosition());
assertEquals(Integer.valueOf(0), relationshipStyle.getPosition());
}

@Test
public void test_setPosition_SetsPositionToOneHundred_WhenANumberGreaterThanOneHundredIsSpecified() {
relationshipStyle.setPosition(101);
assertEquals(new Integer(100), relationshipStyle.getPosition());
assertEquals(Integer.valueOf(100), relationshipStyle.getPosition());
}

@Test
public void test_setPosition_SetsPosition_WhenANumberBetweenZeroAndOneHundredIsSpecified() {
relationshipStyle.setPosition(0);
assertEquals(new Integer(0), relationshipStyle.getPosition());
assertEquals(Integer.valueOf(0), relationshipStyle.getPosition());

relationshipStyle.setPosition(1);
assertEquals(new Integer(1), relationshipStyle.getPosition());
assertEquals(Integer.valueOf(1), relationshipStyle.getPosition());

relationshipStyle.setPosition(50);
assertEquals(new Integer(50), relationshipStyle.getPosition());
assertEquals(Integer.valueOf(50), relationshipStyle.getPosition());


relationshipStyle.setPosition(99);
assertEquals(new Integer(99), relationshipStyle.getPosition());
assertEquals(Integer.valueOf(99), relationshipStyle.getPosition());

relationshipStyle.setPosition(100);
assertEquals(new Integer(100), relationshipStyle.getPosition());
assertEquals(Integer.valueOf(100), relationshipStyle.getPosition());
}

@Test
Expand Down
Loading

0 comments on commit 5d5dccf

Please sign in to comment.