-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
9,479 additions
and
0 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 @@ | ||
--- | ||
exclude_paths: | ||
- '**/test/**' |
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,16 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
|
||
[*.java] | ||
indent_style = tab | ||
|
||
[*.js] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.gradle] | ||
indent_style = tab |
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 @@ | ||
.idea | ||
|
||
### Java | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
### Gradle | ||
.gradle | ||
/build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
|
||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 | ||
# gradle/wrapper/gradle-wrapper.properties | ||
|
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,9 @@ | ||
sudo: required | ||
language: java | ||
|
||
services: | ||
- docker | ||
|
||
jdk: | ||
- openjdk8 | ||
- openjdk11 |
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,209 @@ | ||
// Copyright (c) 2003-present, Jodd Team (http://jodd.org) | ||
// 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. | ||
// | ||
// 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. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 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. | ||
// Copyright (c) 2003-present, Jodd Team (https://jodd.org) | ||
|
||
plugins { | ||
id 'java-library' | ||
id 'maven-publish' | ||
id 'jacoco' | ||
id 'signing' | ||
id 'io.codearte.nexus-staging' version '0.21.2' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
group = 'org.jodd' | ||
//version = '6.0.0.' + timestamp() + "-SNAPSHOT" | ||
version = '6.0.0' | ||
|
||
rootProject.description = 'Java Mail client' | ||
|
||
ext { | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
|
||
dependencies { | ||
|
||
implementation 'org.jodd:jodd-core:5.1.+' | ||
implementation 'jakarta.mail:jakarta.mail-api:1.6.5' | ||
implementation 'com.sun.mail:jakarta.mail:1.6.5' | ||
|
||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.+' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.+' | ||
testImplementation 'com.icegreen:greenmail:1.6.0' | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes( | ||
'Implementation-Title': project.name, | ||
'Implementation-Version': project.version, | ||
'Debug-Info': 'on', | ||
'Built-By': 'jodd.org' | ||
) | ||
} | ||
} | ||
|
||
javadoc { | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
if (JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events "standardOut", "passed", "skipped", "failed" | ||
showExceptions true | ||
exceptionFormat "full" | ||
showCauses true | ||
showStackTraces true | ||
|
||
afterSuite { desc, result -> | ||
if (!desc.parent) { // will match the outermost suite | ||
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)" | ||
def startItem = '| ', endItem = ' |' | ||
def repeatLength = startItem.length() + output.length() + endItem.length() | ||
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) | ||
} | ||
} | ||
} | ||
} | ||
|
||
jacocoTestReport { | ||
reports { | ||
xml.enabled false | ||
csv.enabled false | ||
html.enabled true | ||
} | ||
} | ||
|
||
// | ||
// PUBLISH | ||
// | ||
|
||
ext.admin = hasProperty('sonatypeUsername') | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId = 'jodd-mail' | ||
from components.java | ||
versionMapping { | ||
usage('java-api') { | ||
fromResolutionOf('runtimeClasspath') | ||
} | ||
usage('java-runtime') { | ||
fromResolutionResult() | ||
} | ||
} | ||
pom { | ||
name = 'Jodd Mail' | ||
description = 'Jodd Mail client' | ||
url = 'https://mail.jodd.org' | ||
licenses { | ||
license { | ||
name = 'BSD-2-Clause' | ||
url = 'https://github.com/oblac/jodd-mail/blob/master/LICENSE' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'igor' | ||
name = 'Igor Spasić' | ||
email = 'igor@jodd.org' | ||
timezone = '+1' | ||
} | ||
} | ||
scm { | ||
url = 'https://github.com/oblac/jodd-mail.git' | ||
connection = 'scm:git:git://github.com/oblac/jodd-mail.git' | ||
developerConnection = 'scm:git:ssh://git@github.com/oblac/jodd-mail.git' | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
url = version.contains('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
if (admin) { | ||
credentials { | ||
username sonatypeUsername | ||
password sonatypePassword | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
required { admin } | ||
sign publishing.publications.mavenJava | ||
} | ||
|
||
task install(dependsOn: publishToMavenLocal) { | ||
group = 'Publishing' | ||
description = 'Installs artifacts to local Maven repository' | ||
} | ||
|
||
// | ||
// RELEASE | ||
// | ||
|
||
task release() { | ||
group 'Project' | ||
description 'Rebuilds everything for the release.' | ||
|
||
dependsOn clean | ||
dependsOn build | ||
dependsOn javadoc | ||
dependsOn jacocoTestReport | ||
} | ||
|
||
|
||
// | ||
// UTILS | ||
// | ||
|
||
apply from: "${rootProject.projectDir}/gradle/license.gradle" | ||
|
||
tasks.named('wrapper') { | ||
distributionType = Wrapper.DistributionType.ALL | ||
} | ||
|
||
static def timestamp() { | ||
return new Date().format('yyyyMMddHHmmss') | ||
} |
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,11 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE suppressions PUBLIC | ||
"-//Puppy Crawl//DTD Suppressions 1.1//EN" | ||
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> | ||
|
||
<suppressions> | ||
|
||
<!-- ignore --> | ||
<suppress files=".*[/\\]test[/\\].*" checks=".+"/> | ||
|
||
</suppressions> |
Oops, something went wrong.