-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- POM correct? - Manifest correct? - Thirdparty repackaged? - Sources uploaded? - Javadoc uploaded? Signed-off-by: Peter Gafert <[email protected]>
- Loading branch information
1 parent
56e6770
commit 41a7b65
Showing
8 changed files
with
348 additions
and
1 deletion.
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
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,111 @@ | ||
import java.nio.file.Files | ||
import java.time.LocalDateTime | ||
import java.util.jar.JarFile | ||
import java.util.jar.Manifest | ||
|
||
File scriptRoot = currentScriptRootOf this | ||
def rootUrl = { | ||
if (!project.hasProperty('tngRepoId')) { | ||
throw new IllegalArgumentException( | ||
'You must pass the repo id (see Sonatype Repository Manager -> comtngtech-${repoId}) as parameter, e.g. -P tngRepoId=1162') | ||
} | ||
"https://oss.sonatype.org/service/local/repositories/comtngtech-${tngRepoId}/content/com/tngtech/archunit" | ||
} | ||
|
||
def createArtifactUrl = { String artifactId -> | ||
"${rootUrl()}/${artifactId}/${version}/${artifactId}-${version}" | ||
} | ||
|
||
def getUploadedFile = { String artifactId, String ending, String suffix -> | ||
def fullEnding = (!suffix.isEmpty() ? "-${suffix}" : '') + ".${ending}" | ||
File result = Files.createTempFile(artifactId, fullEnding).toFile() | ||
result.bytes = new URL("${createArtifactUrl(artifactId)}${fullEnding}").bytes | ||
result | ||
} | ||
|
||
def getUploadedFileText = { String artifactId, String ending -> | ||
new URL("${createArtifactUrl(artifactId)}.${ending}").text.stripIndent() | ||
} | ||
|
||
def getExpectedFile = { String artifactId, String ending -> | ||
new File(scriptRoot, "expected/${artifactId}.${ending}").text.replace('${archunit.version}', version).stripIndent() | ||
} | ||
|
||
def checkPom = { String artifactId -> | ||
println "Verifying correct POM of ${artifactId}" | ||
|
||
String actual = getUploadedFileText(artifactId, 'pom') | ||
String expected = getExpectedFile(artifactId, 'pom') | ||
if (actual.replaceAll("\\s", "") != expected.replaceAll("\\s", "")) { | ||
throw new AssertionError("""POM of artifact '${artifactId}' does not match: | ||
-------- | ||
Actual: | ||
${actual} | ||
-------- | ||
Expected: | ||
${expected} | ||
-------- | ||
""") | ||
} | ||
} | ||
|
||
def checkManifest = { String artifactId, Manifest manifest -> | ||
println "Verifying correct Manifest of ${artifactId}" | ||
|
||
def checkAttributes = { expected -> | ||
expected.each { key, value -> | ||
assert manifest.mainAttributes.getValue(key) == value | ||
} | ||
} | ||
checkAttributes([ | ||
'Specification-Title' : "ArchUnit - Module '${artifactId}'", | ||
'Specification-Version' : version, | ||
'Specification-Vendor' : 'TNG Technology Consulting GmbH', | ||
'Implementation-Title' : "com.tngtech.${artifactId.replace('-', '.')}", | ||
'Implementation-Version': version, | ||
'Implementation-Vendor' : 'TNG Technology Consulting GmbH', | ||
'Issue-Tracker' : 'https://github.com/TNG/ArchUnit/issues', | ||
'Documentation-URL' : 'https://github.com/TNG/ArchUnit', | ||
'Copyright' : "${LocalDateTime.now().year} TNG Technology Consulting GmbH", | ||
'License' : 'The Apache Software License, Version 2.0', | ||
'Automatic-Module-Name' : "com.tngtech.${artifactId.replaceFirst('-', '.').replaceFirst('-', '.').replace('-', '')}" | ||
]) | ||
} | ||
|
||
def checkThirdParty = { JarFile jarFile -> | ||
assert jarFile.getEntry('com/tngtech/archunit/thirdparty/org/objectweb/asm/ClassVisitor.class') != null: 'ASM is missing from 3rd party' | ||
assert jarFile.getEntry('com/tngtech/archunit/thirdparty/org/objectweb/asm/asm.license') != null: 'ASM license is missing from 3rd party' | ||
assert jarFile.getEntry('com/tngtech/archunit/thirdparty/com/google/common/collect/ImmutableSet.class') != null: 'Guava is missing from 3rd party' | ||
} | ||
|
||
def checkNoThirdParty = { JarFile jarFile -> | ||
assert jarFile.getEntry('com/tngtech/archunit/thirdparty') == null: 'There exists a third party folder' | ||
} | ||
|
||
def checkSourcesExist = { String artifactId -> | ||
assert getUploadedFile(artifactId, 'jar', 'sources') != null | ||
} | ||
|
||
def checkJavadocExists = { String artifactId -> | ||
assert getUploadedFile(artifactId, 'jar', 'javadoc') != null | ||
} | ||
|
||
task checkUploadedArtifacts { | ||
doLast { | ||
releaseProjects.each { Project project -> | ||
checkPom(project.name) | ||
checkSourcesExist(project.name) | ||
checkJavadocExists(project.name) | ||
|
||
JarFile jarFile = new JarFile(getUploadedFile(project.name, 'jar', '')) | ||
checkManifest(project.name, jarFile.manifest) | ||
if (project.repackagesAsm) { | ||
println "Artifact ${project.name} is configured to repackage 3rd party libs -> checking existence of 3rd party package..." | ||
checkThirdParty(jarFile) | ||
} else { | ||
println "Artifact ${project.name} is configured to not repackage 3rd party libs -> checking absense of 3rd party package..." | ||
checkNoThirdParty(jarFile) | ||
} | ||
} | ||
} | ||
} |
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,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit-junit4</artifactId> | ||
<version>${archunit.version}</version> | ||
<name>ArchUnit</name> | ||
<description>A Java architecture test library, to specify and assert architecture rules in plain Java - Module 'archunit-junit4'</description> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
<organization> | ||
<name>TNG Technology Consulting GmbH</name> | ||
<url>https://www.tngtech.com/</url> | ||
</organization> | ||
<licenses> | ||
<license> | ||
<name>The Apache Software License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<developers> | ||
<developer> | ||
<id>codecholeric</id> | ||
<name>Peter Gafert</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
</developers> | ||
<scm> | ||
<connection>scm:[email protected]:TNG/ArchUnit.git</connection> | ||
<developerConnection>scm:[email protected]:TNG/ArchUnit.git</developerConnection> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit</artifactId> | ||
<version>${archunit.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit-junit5-api</artifactId> | ||
<version>${archunit.version}</version> | ||
<name>ArchUnit</name> | ||
<description>A Java architecture test library, to specify and assert architecture rules in plain Java - Module 'archunit-junit5-api'</description> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
<organization> | ||
<name>TNG Technology Consulting GmbH</name> | ||
<url>https://www.tngtech.com/</url> | ||
</organization> | ||
<licenses> | ||
<license> | ||
<name>The Apache Software License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<developers> | ||
<developer> | ||
<id>codecholeric</id> | ||
<name>Peter Gafert</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
</developers> | ||
<scm> | ||
<connection>scm:[email protected]:TNG/ArchUnit.git</connection> | ||
<developerConnection>scm:[email protected]:TNG/ArchUnit.git</developerConnection> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit</artifactId> | ||
<version>${archunit.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
43 changes: 43 additions & 0 deletions
43
build-steps/release/expected/archunit-junit5-engine-api.pom
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,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit-junit5-engine-api</artifactId> | ||
<version>${archunit.version}</version> | ||
<name>ArchUnit</name> | ||
<description>A Java architecture test library, to specify and assert architecture rules in plain Java - Module 'archunit-junit5-engine-api' | ||
</description> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
<organization> | ||
<name>TNG Technology Consulting GmbH</name> | ||
<url>https://www.tngtech.com/</url> | ||
</organization> | ||
<licenses> | ||
<license> | ||
<name>The Apache Software License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<developers> | ||
<developer> | ||
<id>codecholeric</id> | ||
<name>Peter Gafert</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
</developers> | ||
<scm> | ||
<connection>scm:[email protected]:TNG/ArchUnit.git</connection> | ||
<developerConnection>scm:[email protected]:TNG/ArchUnit.git</developerConnection> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit.platform</groupId> | ||
<artifactId>junit-platform-engine</artifactId> | ||
<version>1.5.1</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit-junit5-engine</artifactId> | ||
<version>${archunit.version}</version> | ||
<name>ArchUnit</name> | ||
<description>A Java architecture test library, to specify and assert architecture rules in plain Java - Module 'archunit-junit5-engine' | ||
</description> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
<organization> | ||
<name>TNG Technology Consulting GmbH</name> | ||
<url>https://www.tngtech.com/</url> | ||
</organization> | ||
<licenses> | ||
<license> | ||
<name>The Apache Software License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<developers> | ||
<developer> | ||
<id>codecholeric</id> | ||
<name>Peter Gafert</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
</developers> | ||
<scm> | ||
<connection>scm:[email protected]:TNG/ArchUnit.git</connection> | ||
<developerConnection>scm:[email protected]:TNG/ArchUnit.git</developerConnection> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit</artifactId> | ||
<version>${archunit.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit-junit5-api</artifactId> | ||
<version>${archunit.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit-junit5-engine-api</artifactId> | ||
<version>${archunit.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.tngtech.archunit</groupId> | ||
<artifactId>archunit</artifactId> | ||
<version>${archunit.version}</version> | ||
<name>ArchUnit</name> | ||
<description>A Java architecture test library, to specify and assert architecture rules in plain Java - Module 'archunit'</description> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
<organization> | ||
<name>TNG Technology Consulting GmbH</name> | ||
<url>https://www.tngtech.com/</url> | ||
</organization> | ||
<licenses> | ||
<license> | ||
<name>The Apache Software License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
<license> | ||
<name>BSD</name> | ||
<url>http://asm.ow2.io/license.html</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<developers> | ||
<developer> | ||
<id>codecholeric</id> | ||
<name>Peter Gafert</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
</developers> | ||
<scm> | ||
<connection>scm:[email protected]:TNG/ArchUnit.git</connection> | ||
<developerConnection>scm:[email protected]:TNG/ArchUnit.git</developerConnection> | ||
<url>https://github.com/TNG/ArchUnit</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>1.7.25</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
File renamed without changes.