diff --git a/.circleci/config.yml b/.circleci/config.yml
index 21a1bf0..d21cbc7 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -4,43 +4,51 @@ defaults: &defaults
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
+ CI: true
+
+defaults_gradle: &defaults_gradle
+ steps:
+ - checkout
+ - restore_cache:
+ keys:
+ - gradle-dependencies-{{ checksum "build.gradle.kts" }}
+ # fallback to using the latest cache if no exact match is found
+ - gradle-dependencies-
+ - run:
+ name: Gradle Dependencies
+ command: ./gradlew dependencies
+ - save_cache:
+ paths: ~/.m2
+ key: gradle-dependencies-{{ checksum "build.gradle.kts" }}
+ - run:
+ name: Run All Checks
+ command: ./gradlew check
+ - store_artifacts:
+ path: build/reports/
+ destination: reports
+ - store_test_results:
+ path: build/reports/
jobs:
+ build_gradle_jdk14:
+ <<: *defaults
- build_gradle:
+ docker:
+ - image: openjdk:14-jdk
+
+ <<: *defaults_gradle
+
+ build_gradle_jdk8:
<<: *defaults
docker:
- image: circleci/openjdk:8-jdk
- steps:
- - checkout
- - restore_cache:
- keys:
- - gradle-dependencies-{{ checksum "build.gradle.kts" }}
- # fallback to using the latest cache if no exact match is found
- - gradle-dependencies-
-
- - run:
- name: Gradle Dependencies
- command: ./gradlew dependencies
-
- - save_cache:
- paths: ~/.m2
- key: gradle-dependencies-{{ checksum "build.gradle.kts" }}
-
- - run:
- name: Run All Checks
- command: ./gradlew check
-
- - store_artifacts:
- path: build/reports/
- destination: reports
- - store_test_results:
- path: build/reports/
+ <<: *defaults_gradle
workflows:
version: 2
gradle:
- jobs:
- - build_gradle
+ jobs:
+ - build_gradle_jdk8
+ - build_gradle_jdk14
diff --git a/.github_changelog_generator b/.github_changelog_generator
new file mode 100644
index 0000000..6236107
--- /dev/null
+++ b/.github_changelog_generator
@@ -0,0 +1 @@
+future-release=1.0.2
diff --git a/.gitignore b/.gitignore
index aa7ddd5..9dda44b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,17 +2,7 @@
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
-.classpath
-.DS_Store
-.gradle
-.kobalt
-.nb-gradle
-.project
-.settings
-.vscode/*
-*.code-workspace
-*.iws
-*.sublime-*
+**/*.class
**/.idea/**/dataSources.ids
**/.idea/**/dataSources.local.xml
**/.idea/**/dataSources/
@@ -27,7 +17,17 @@
**/.idea/**/uiDesigner.xml
**/.idea/**/usage.statistics.xml
**/.idea/**/workspace.xml
-**/*.class
+*.code-workspace
+*.iws
+*.sublime-*
+.DS_Store
+.classpath
+.gradle
+.kobalt
+.nb-gradle
+.project
+.settings
+.vscode/*
/bin
/build
/deploy
@@ -40,7 +40,8 @@
/project.properties
/target
/test-output
+Thumbs.db
ehthumbs.db
kobaltBuild
kobaltw*-test
-Thumbs.db
\ No newline at end of file
+pom.xml.asc
diff --git a/.travis.yml b/.travis.yml
index 36134ea..48c5805 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,30 +5,22 @@ env:
global:
- CI=true
-jdk:
- - oraclejdk8
+#install:
+# - git fetch --unshallow --tags
addons:
sonarcloud:
organization: "ethauvin-github"
-before_cache:
- - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
+jdk:
+ - oraclejdk8
+ - openjdk14
before_install:
- chmod +x gradlew
-script:
- - ./gradlew check
-
-cache:
- directories:
- - $HOME/.gradle/caches/
- - $HOME/.gradle/wrapper/
-
after_success:
- |
- if [ "${TRAVIS_TEST_RESULT}" == 0 ]; then
+ if [ "${TRAVIS_TEST_RESULT}" == 0 ] && [ "$TRAVIS_JDK_VERSION" == "openjdk14" ]; then
./gradlew sonarqube
fi
diff --git a/CHANGELOG.md b/CHANGELOG.md
index adfacec..366e7bd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,19 @@
-# Change Log
+# Changelog
+
+## [1.0.2](https://github.com/ethauvin/pinboard-poster/tree/1.0.2) (2021-03-21)
+
+[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/1.0.1...1.0.2)
+
+**Implemented enhancements:**
+
+- Use HttpLoggingInterceptor instead of manually logging. [\#3](https://github.com/ethauvin/pinboard-poster/issues/3)
+
+**Fixed bugs:**
+
+- executeMethod should trap IO execeptions [\#2](https://github.com/ethauvin/pinboard-poster/issues/2)
## [1.0.1](https://github.com/ethauvin/pinboard-poster/tree/1.0.1) (2019-05-27)
+
[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/1.0.0...1.0.1)
**Implemented enhancements:**
@@ -8,15 +21,21 @@
- Implement better error reporting. [\#1](https://github.com/ethauvin/pinboard-poster/issues/1)
## [1.0.0](https://github.com/ethauvin/pinboard-poster/tree/1.0.0) (2018-06-26)
+
[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/0.9.3...1.0.0)
## [0.9.3](https://github.com/ethauvin/pinboard-poster/tree/0.9.3) (2017-11-09)
+
[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/0.9.2...0.9.3)
## [0.9.2](https://github.com/ethauvin/pinboard-poster/tree/0.9.2) (2017-11-08)
+
[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/0.9.1...0.9.2)
## [0.9.1](https://github.com/ethauvin/pinboard-poster/tree/0.9.1) (2017-05-18)
+[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/2ee3568e40114e19b0956ea7d12c071d5c49b0d5...0.9.1)
-\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\ No newline at end of file
+
+
+\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
diff --git a/LICENSE.txt b/LICENSE.txt
index 22a50b9..8e33202 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2017-2020, Erik C. Thauvin (erik@thauvin.net)
+Copyright (c) 2017-2021, Erik C. Thauvin (erik@thauvin.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/README.md b/README.md
index b43dbf2..2a6f5cf 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
# [Pinboard](https://pinboard.in) Poster for Kotlin/Java
-[](http://opensource.org/licenses/BSD-3-Clause) [](https://github.com/ethauvin/pinboard-poster/releases/latest) [](https://bintray.com/ethauvin/maven/pinboard-poster/_latestVersion)
+[](http://opensource.org/licenses/BSD-3-Clause) [](https://github.com/ethauvin/pinboard-poster/releases/latest) [](https://search.maven.org/search?q=g:%22net.thauvin.erik%22%20AND%20a:%22pinboard-poster%22)
+
[](https://snyk.io/test/github/ethauvin/pinboard-poster?targetFile=pom.xml) [](https://sonarcloud.io/dashboard?id=ethauvin_pinboard-poster) [](https://travis-ci.com/ethauvin/pinboard-poster) [](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master)
A small Kotlin/Java/Android library for posting to [Pinboard](https://pinboard.in).
@@ -31,32 +32,20 @@ poster.deletePin("http:///www.example.com/bar");
Your API authentication token is available on the [Pinboard settings page](https://pinboard.in/settings/password).
-## Usage with Maven and Gradle
-
-### Maven
-
-To install and run from Maven, configure an artifact as follows:
-
-```xml
-
- net.thauvin.erik
- pinboard-poster
- 1.0.1
-
-```
-
-### Gradle
+## Usage with Gradle, Maven, etc.
To install and run from Gradle, add the following to the build.gradle file:
```gradle
dependencies {
- compile 'net.thauvin.erik:pinboard-poster:1.0.1'
+ compile 'net.thauvin.erik:pinboard-poster:1.0.2'
}
```
[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/samples/java/build.gradle)
[View Kotlin DSL Example](https://github.com/ethauvin/pinboard-poster/blob/master/samples/kotlin/build.gradle.kts)
+Instructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://search.maven.org/artifact/net.thauvin.erik/pinboard-poster/1.0.2/jar).
+
## Adding
The `addPin` function support all of the [Pinboard API parameters](https://pinboard.in/api/#posts_add):
diff --git a/build.gradle.kts b/build.gradle.kts
index 4fad287..7ec04ba 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,22 +1,19 @@
-import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import java.io.FileInputStream
-import java.util.Properties
plugins {
jacoco
java
- kotlin("jvm") version "1.4.0"
+ kotlin("jvm") version "1.4.31"
`maven-publish`
- id("com.github.ben-manes.versions") version "0.29.0"
- id("com.jfrog.bintray") version "1.8.5"
- id("io.gitlab.arturbosch.detekt") version "1.11.1"
- id("org.jetbrains.dokka") version "1.4.0-rc"
- id("org.sonarqube") version "3.0"
+ signing
+ id("com.github.ben-manes.versions") version "0.38.0"
+ id("io.gitlab.arturbosch.detekt") version "1.16.0"
+ id("org.jetbrains.dokka") version "1.4.30"
+ id("org.sonarqube") version "3.1.1"
}
group = "net.thauvin.erik"
-version = "1.0.1"
+version = "1.0.2"
description = "Pinboard Poster for Kotlin/Java"
val gitHub = "ethauvin/$name"
@@ -26,45 +23,32 @@ var isRelease = "release" in gradle.startParameter.taskNames
val publicationName = "mavenJava"
-// Load local.properties
-File("local.properties").apply {
- if (exists()) {
- FileInputStream(this).use { fis ->
- Properties().apply {
- load(fis)
- forEach { (k, v) ->
- extra[k as String] = v
- }
- }
- }
- }
-}
-
object VersionInfo {
- const val okhttp = "4.8.1"
+ const val okhttp = "4.9.1"
}
val versions: VersionInfo by extra { VersionInfo }
repositories {
- jcenter()
+ mavenCentral()
+ jcenter() // needed for Dokka
}
dependencies {
implementation("com.squareup.okhttp3:okhttp:${versions.okhttp}")
implementation("com.squareup.okhttp3:logging-interceptor:${versions.okhttp}")
- testImplementation("org.testng:testng:7.3.0")
+ testImplementation("org.testng:testng:7.4.0")
+}
+
+java {
+ withSourcesJar()
}
detekt {
baseline = project.rootDir.resolve("config/detekt/baseline.xml")
}
-jacoco {
- toolVersion = "0.8.5"
-}
-
sonarqube {
properties {
property("sonar.projectKey", "ethauvin_pinboard-poster")
@@ -72,11 +56,6 @@ sonarqube {
}
}
-val sourcesJar by tasks.creating(Jar::class) {
- archiveClassifier.set("sources")
- from(sourceSets.getByName("main").allSource)
-}
-
val javadocJar by tasks.creating(Jar::class) {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc)
@@ -106,7 +85,7 @@ tasks {
}
assemble {
- dependsOn(sourcesJar, javadocJar)
+ dependsOn(javadocJar)
}
clean {
@@ -147,19 +126,15 @@ tasks {
}
}
- val bintrayUpload by existing(BintrayUploadTask::class) {
- dependsOn(publishToMavenLocal, gitTag)
- }
-
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
setTermsOfServiceAgree("yes")
}
register("release") {
- description = "Publishes version ${project.version} to Bintray."
+ description = "Publishes version ${project.version} to local repository."
group = PublishingPlugin.PUBLISH_TASK_GROUP
- dependsOn("wrapper", bintrayUpload)
+ dependsOn("wrapper", "deploy", "gitTag", "publishToMavenLocal")
}
"sonarqube" {
@@ -167,69 +142,51 @@ tasks {
}
}
-fun findProperty(s: String) = project.findProperty(s) as String?
-bintray {
- user = findProperty("bintray.user")
- key = findProperty("bintray.apikey")
- publish = isRelease
- setPublications(publicationName)
- pkg.apply {
- repo = "maven"
- name = project.name
- desc = description
- websiteUrl = mavenUrl
- issueTrackerUrl = "$mavenUrl/issues"
- githubRepo = gitHub
- githubReleaseNotesFile = "README.md"
- vcsUrl = "$mavenUrl.git"
- setLabels("android", "kotlin", "java", "pinboard", "poster", "bookmarks")
- publicDownloadNumbers = true
- version.apply {
- name = project.version as String
- desc = description
- vcsTag = project.version as String
- gpg.apply {
- sign = true
- }
- }
- }
-}
-
publishing {
publications {
create(publicationName) {
from(components["java"])
- artifact(sourcesJar)
artifact(javadocJar)
- pom.withXml {
- asNode().apply {
- appendNode("name", project.name)
- appendNode("description", project.description)
- appendNode("url", mavenUrl)
-
- appendNode("licenses").appendNode("license").apply {
- appendNode("name", "BSD 3-Clause")
- appendNode("url", "https://opensource.org/licenses/BSD-3-Clause")
+ pom {
+ name.set(project.name)
+ description.set(project.description)
+ url.set(mavenUrl)
+ licenses {
+ license {
+ name.set("BSD 3-Clause")
+ url.set("https://opensource.org/licenses/BSD-3-Clause")
}
-
- appendNode("developers").appendNode("developer").apply {
- appendNode("id", "ethauvin")
- appendNode("name", "Erik C. Thauvin")
- appendNode("email", "erik@thauvin.net")
- }
-
- appendNode("scm").apply {
- appendNode("connection", "scm:git:$mavenUrl.git")
- appendNode("developerConnection", "scm:git:git@github.com:$gitHub.git")
- appendNode("url", mavenUrl)
- }
-
- appendNode("issueManagement").apply {
- appendNode("system", "GitHub")
- appendNode("url", "$mavenUrl/issues")
+ }
+ developers {
+ developer {
+ id.set("ethauvin")
+ name.set("Erik C. Thauvin")
+ email.set("erik@thauvin.net")
+ url.set("https://erik.thauvin.net/")
}
}
+ scm {
+ connection.set("scm:git:git://github.com/$gitHub.git")
+ developerConnection.set("scm:git:git@github.com:$gitHub.git")
+ url.set("$mavenUrl")
+ }
+ issueManagement {
+ system.set("GitHub")
+ url.set("$mavenUrl/issues")
+ }
}
}
}
+ repositories {
+ maven {
+ name = "ossrh"
+ url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
+ credentials(PasswordCredentials::class)
+ }
+ }
+}
+
+signing {
+ useGpgCmd()
+ sign(publishing.publications[publicationName])
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 6c9a224..442d913 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/pom.xml b/pom.xml
index a3d4392..ee2d0a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,23 +1,14 @@
+
+
+
+
+
4.0.0
net.thauvin.erik
pinboard-poster
- 1.0.1
-
-
- com.squareup.okhttp3
- okhttp
- 3.14.2
- compile
-
-
- org.jetbrains.kotlin
- kotlin-stdlib
- 1.3.31
- compile
-
-
+ 1.0.2
pinboard-poster
Pinboard Poster for Kotlin/Java
https://github.com/ethauvin/pinboard-poster
@@ -32,10 +23,11 @@
ethauvin
Erik C. Thauvin
erik@thauvin.net
+ https://erik.thauvin.net/
- scm:git:https://github.com/ethauvin/pinboard-poster.git
+ scm:git:git://github.com/ethauvin/pinboard-poster.git
scm:git:git@github.com:ethauvin/pinboard-poster.git
https://github.com/ethauvin/pinboard-poster
@@ -43,4 +35,24 @@
GitHub
https://github.com/ethauvin/pinboard-poster/issues
+
+
+ org.jetbrains.kotlin
+ kotlin-stdlib-jdk8
+ 1.4.31
+ compile
+
+
+ com.squareup.okhttp3
+ okhttp
+ 4.9.1
+ runtime
+
+
+ com.squareup.okhttp3
+ logging-interceptor
+ 4.9.1
+ runtime
+
+
diff --git a/samples/java/build.gradle b/samples/java/build.gradle
index 165bd4c..80b274a 100644
--- a/samples/java/build.gradle
+++ b/samples/java/build.gradle
@@ -3,17 +3,17 @@ plugins {
id 'application'
}
-// .gradlew run
+// ./gradlew run
defaultTasks 'run'
mainClassName = 'net.thauvin.erik.pinboard.samples.JavaExample'
-dependencies {
- compile 'net.thauvin.erik:pinboard-poster:1.0.1'
-}
-
repositories {
mavenLocal()
- jcenter()
+ mavenCentral()
+}
+
+dependencies {
+ compile 'net.thauvin.erik:pinboard-poster:1.0.2'
}
diff --git a/samples/java/gradle/wrapper/gradle-wrapper.properties b/samples/java/gradle/wrapper/gradle-wrapper.properties
index 6c9a224..442d913 100644
--- a/samples/java/gradle/wrapper/gradle-wrapper.properties
+++ b/samples/java/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/samples/kotlin/build.gradle.kts b/samples/kotlin/build.gradle.kts
index 43907fb..959a788 100644
--- a/samples/kotlin/build.gradle.kts
+++ b/samples/kotlin/build.gradle.kts
@@ -1,21 +1,21 @@
plugins {
application
- kotlin("jvm") version "1.4.0"
+ kotlin("jvm") version "1.4.31"
}
-// .gradlew run
+// ./gradlew run
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
+repositories {
+ mavenLocal()
+ mavenCentral()
+}
+
dependencies {
- compile("net.thauvin.erik:pinboard-poster:1.0.1")
+ compile("net.thauvin.erik:pinboard-poster:1.0.2")
}
application {
mainClassName = "net.thauvin.erik.pinboard.samples.KotlinExampleKt"
}
-
-repositories {
- mavenLocal()
- jcenter()
-}
diff --git a/samples/kotlin/gradle/wrapper/gradle-wrapper.properties b/samples/kotlin/gradle/wrapper/gradle-wrapper.properties
index 6c9a224..442d913 100644
--- a/samples/kotlin/gradle/wrapper/gradle-wrapper.properties
+++ b/samples/kotlin/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt b/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt
index 7127b66..ef2a864 100644
--- a/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt
+++ b/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt
@@ -1,7 +1,7 @@
/*
* PinboardPoster.kt
*
- * Copyright (c) 2017-2020, Erik C. Thauvin (erik@thauvin.net)
+ * Copyright (c) 2017-2021, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt b/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt
index a70691a..0c724c7 100644
--- a/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt
+++ b/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt
@@ -1,7 +1,7 @@
/*
* PinboardPosterTest.kt
*
- * Copyright (c) 2017-2020, Erik C. Thauvin (erik@thauvin.net)
+ * Copyright (c) 2017-2021, Erik C. Thauvin (erik@thauvin.net)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without