Skip to content

Commit

Permalink
Renamed license and contributing related files to be consistent with …
Browse files Browse the repository at this point in the history
…OSS guide lines

Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
  • Loading branch information
codecholeric committed May 5, 2018
1 parent 5210f07 commit c659570
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 233 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Contributions are very welcome. The following will provide some helpful guidelin
* You will only submit contributions to which you have the necessary rights.
This means in particular, that if you are employed you have received the necessary permissions
from your employer to make the contributions.
* Whatever content you contribute will be provided under the project license(s) (see ["LICENSE.txt"](LICENSE.txt))
* Whatever content you contribute will be provided under the project license(s) (see ["LICENSE"](LICENSE))

## How to contribute

Expand All @@ -29,7 +29,7 @@ If your commit refers to an issue, please post-fix it with the issue number, e.g
Issue: #123
```

Furthermore, commits should be signed according to the [DCO](DCO.md).
Furthermore, commits should be signed according to the [DCO](DCO).

### Pull Requests

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion NOTICE.md → NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ArchUnit
Copyright 2016 and onwards TNG Technology Consulting GmbH
Copyright 2016 and onwards Peter Gafert <peter.gafert@tngtech.com>

This product includes software developed at
TNG Technology Consulting GmbH (https://www.tngtech.com/).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/TNG/ArchUnit.png?branch=master)](https://travis-ci.org/TNG/ArchUnit)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.tngtech.archunit/archunit/badge.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.tngtech.archunit%22%20)
[![License](https://img.shields.io/github/license/TNG/ArchUnit.svg)](https://github.com/TNG/ArchUnit/blob/master/LICENSE.txt)
[![License](https://img.shields.io/github/license/TNG/ArchUnit.svg)](https://github.com/TNG/ArchUnit/blob/master/LICENSE)

<img src="logo/ArchUnit-Logo.png" height="64" alt="ArchUnit">

Expand Down
202 changes: 0 additions & 202 deletions build-steps/license/archunit.license.template

This file was deleted.

24 changes: 13 additions & 11 deletions build-steps/license/license.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
String archUnitLicenseFile = 'licenses/archunit.license'
String guavaLicenseFile = 'licenses/guava.license'
String asmLicenseFile = 'licenses/asm.license'

Expand All @@ -9,8 +8,12 @@ def fillTemplateFile = {
replace('${owner}', "${company.name}")
}

def pomOf = { String dep ->
"${dep}@pom"
}

def parentPomOf = { String dep ->
dep.replaceAll(/(.*:)(.*)(:.*)/, /$1$2-parent$3@pom/)
pomOf(dep.replaceAll(/(.*:)(.*)(:.*)/, /$1$2-parent$3/))
}

configurations {
Expand All @@ -19,7 +22,7 @@ configurations {
}

dependencies {
thirdpartyAsm parentPomOf(dependency.asm)
thirdpartyAsm pomOf(dependency.asm)
thirdpartyGuava parentPomOf(dependency.guava)
}

Expand Down Expand Up @@ -63,23 +66,22 @@ ${text}
// Pretty dirty, but I couldn't find an official plain text version online
def unwrapHtml = { htmlInput ->
def html = htmlInput
while (!html.startsWith('Copyright (c)') && html.contains('<pre>')) {
while (!html.matches(/(?s)[^<]*Copyright.*/) && html.contains('<pre>')) {
html = html.substring(html.indexOf('<pre>') + 5, html.length()).trim()
}

assert html.startsWith('Copyright (c)'):
"Couldn't find license tag (looked for <pre>Copyright (c)...</pre> within ${html})"
assert html.contains('Copyright'):
"Couldn't find license tag (looked for <pre>...Copyright...</pre> within ${html})"

html.substring(0, html.indexOf('</pre>'))
}

task updateLicenses {
doLast {
rootProject.file(archUnitLicenseFile).text = fillTemplateFile('archunit.license.template')
rootProject.file('LICENSE.txt').text = rootProject.file(archUnitLicenseFile).text // so Github can understand it

rootProject.file(asmLicenseFile).text = createLicense(parseLicenseInfoFrom(configurations.thirdpartyAsm), unwrapHtml)

def asmLicenseWorkaround = parseLicenseInfoFrom(configurations.thirdpartyAsm)
// No, they can never adhere to conventions :-( The URL from the POM at the moment forwards to the root page
asmLicenseWorkaround = [name: asmLicenseWorkaround.name, url: new URL(asmLicenseWorkaround.url.toString().replace('.org', '.io'))]
rootProject.file(asmLicenseFile).text = createLicense(asmLicenseWorkaround, unwrapHtml)
rootProject.file(guavaLicenseFile).text = createLicense(parseLicenseInfoFrom(configurations.thirdpartyGuava))
}
}
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ext {
guavaRelocationPackage = "${thirdPartyRelocationPackage}.com.google"

dependency = [
asm : 'org.ow2.asm:asm:6.0',
asm : 'org.ow2.asm:asm:6.1.1',
guava : 'com.google.guava:guava:19.0',
slf4j : 'org.slf4j:slf4j-api:1.7.7',
log4j_api : 'org.apache.logging.log4j:log4j-api:2.1',
Expand Down Expand Up @@ -96,6 +96,10 @@ task wrapper(type: Wrapper) {
allprojects {
group = 'com.tngtech.archunit'
version = '1.0.0-SNAPSHOT'

repositories {
mavenCentral()
}
}

description = 'A Java architecture test library, to specify and assert architecture rules in plain Java'
Expand All @@ -114,10 +118,6 @@ subprojects {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

repositories {
mavenCentral()
}

test {
maxHeapSize = "2G"

Expand Down
19 changes: 8 additions & 11 deletions licenses/asm.license
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
Name: BSD
Url : http://asm.objectweb.org/license.html
Url : http://asm.ow2.io/license.html

-------------------------------------------
------------------------------------

ASM: a very small and fast Java bytecode manipulation framework
Copyright (c) 2000-2011 INRIA, France Telecom
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Expand All @@ -32,4 +30,3 @@ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.

0 comments on commit c659570

Please sign in to comment.