-
-
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
deleted file mode 100644
index dd4c951..0000000
--- a/.idea/inspectionProfiles/profiles_settings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
deleted file mode 100644
index 83bf06e..0000000
--- a/.idea/kotlinc.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries-with-intellij-classes.xml b/.idea/libraries-with-intellij-classes.xml
deleted file mode 100644
index 9fa3156..0000000
--- a/.idea/libraries-with-intellij-classes.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml
new file mode 100644
index 0000000..ca84ff0
--- /dev/null
+++ b/.idea/libraries/bld.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/libraries/compile.xml b/.idea/libraries/compile.xml
new file mode 100644
index 0000000..9bd86aa
--- /dev/null
+++ b/.idea/libraries/compile.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/runtime.xml b/.idea/libraries/runtime.xml
new file mode 100644
index 0000000..2ae5c4b
--- /dev/null
+++ b/.idea/libraries/runtime.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/test.xml b/.idea/libraries/test.xml
new file mode 100644
index 0000000..b80486a
--- /dev/null
+++ b/.idea/libraries/test.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 336a5ac..dd194dc 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,19 +1,23 @@
-
+
+
+
+
-
-
+
-
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 917a540..55adcb9 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -2,7 +2,8 @@
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/samples-kotlin.iml b/.idea/modules/samples-kotlin.iml
deleted file mode 100644
index 813d9e8..0000000
--- a/.idea/modules/samples-kotlin.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/Run Tests.xml b/.idea/runConfigurations/Run Tests.xml
new file mode 100644
index 0000000..2d4326e
--- /dev/null
+++ b/.idea/runConfigurations/Run Tests.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/scopes/Source.xml b/.idea/scopes/Source.xml
deleted file mode 100644
index 942e059..0000000
--- a/.idea/scopes/Source.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
deleted file mode 100644
index e96534f..0000000
--- a/.idea/uiDesigner.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7..35eb1dd 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..f25500c
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,11 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "java",
+ "name": "Run Tests",
+ "request": "launch",
+ "mainClass": "net.thauvin.erik.pinboard.PinboardPosterTest"
+ }
+ ]
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..133aa45
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,15 @@
+{
+ "java.project.sourcePaths": [
+ "src/main/java",
+ "src/main/resources",
+ "src/test/java",
+ "src/bld/java"
+ ],
+ "java.configuration.updateBuildConfiguration": "automatic",
+ "java.project.referencedLibraries": [
+ "${HOME}/.bld/dist/bld-1.7.5.jar",
+ "lib/compile/*.jar",
+ "lib/runtime/*.jar",
+ "lib/test/*.jar"
+ ]
+}
diff --git a/README.md b/README.md
index 9493ee0..0aa6f0c 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,11 @@
# [Pinboard](https://pinboard.in) Poster for Kotlin, Java and Android
-[](https://opensource.org/licenses/BSD-3-Clause) [](https://github.com/ethauvin/pinboard-poster/releases/latest)
-[](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/pinboard-poster/)
+[](https://opensource.org/licenses/BSD-3-Clause)
+[](https://kotlinlang.org/)
+[](https://github.com/ethauvin/pinboard-poster/releases/latest)
[](https://central.sonatype.com/artifact/net.thauvin.erik/pinboard-poster)
+[](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/pinboard-poster/)
+
[](https://sonarcloud.io/dashboard?id=ethauvin_pinboard-poster)
[](https://github.com/ethauvin/pinboard-poster/actions/workflows/gradle.yml)
@@ -24,7 +27,7 @@ poster.deletePin("https:///www.example.com/bar")
```
-[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/samples/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt)
+[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples)
### Java
@@ -41,13 +44,28 @@ poster.addPin(new PinConfig.Builder()
poster.deletePin("https:///www.example.com/bar");
```
-[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java)
+[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples)
Your API authentication token is available on the [Pinboard settings page](https://pinboard.in/settings/password).
-## Usage with Gradle, Maven, etc.
-To install and run from Gradle, add the following to the build.gradle file:
+## bld
+
+To use with [bld](https://rife2.com/bld), include the following dependency in your [build](https://github.com/ethauvin/pinboard-poster/blob/master/examples/bld/src/bld/java/net/thauvin/erik/pinboard/samples/ExampleBuild.java) file:
+
+```java
+repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);
+
+scope(compile)
+ .include(dependency("net.thauvin.erik:pinboard-poster:1.1.0"));
+```
+Be sure to use the [bld Kotlin extension](https://github.com/rife2/bld-kotlin) in your project.
+
+[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/examples/bld/)
+
+## Gradle, Maven, etc.
+
+To install and run from Gradle, add the following to the `build.gradle` file:
```gradle
repositories {
@@ -59,8 +77,7 @@ dependencies {
}
```
-[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)
+[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples/gradle/)
Instructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://central.sonatype.com/artifact/net.thauvin.erik/pinboard-poster).
diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml
index a9514a0..7c85194 100644
--- a/bitbucket-pipelines.yml
+++ b/bitbucket-pipelines.yml
@@ -1,9 +1,10 @@
-image: maven:3-openjdk-18
+image: openjdk:17
pipelines:
default:
- step:
- caches:
- - gradle
+ name: Test with bld
script:
- - bash ./gradlew check
+ - ./bld download
+ - ./bld compile
+ - ./bld test
diff --git a/bld b/bld
new file mode 100755
index 0000000..3c1df97
--- /dev/null
+++ b/bld
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+java -jar "$(dirname "$0")/lib/bld/bld-wrapper.jar" "$0" --build net.thauvin.erik.pinboard.PinboardPosterBuild "$@"
diff --git a/bld.bat b/bld.bat
new file mode 100644
index 0000000..1262822
--- /dev/null
+++ b/bld.bat
@@ -0,0 +1,4 @@
+@echo off
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+java -jar "%DIRNAME%/lib/bld/bld-wrapper.jar" "%0" --build net.thauvin.erik.pinboard.PinboardPosterBuild %*
diff --git a/build.gradle.kts b/build.gradle.kts
deleted file mode 100644
index 6c1b57c..0000000
--- a/build.gradle.kts
+++ /dev/null
@@ -1,213 +0,0 @@
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
-import org.gradle.api.tasks.testing.logging.TestExceptionFormat
-import org.gradle.api.tasks.testing.logging.TestLogEvent
-
-plugins {
- id("com.github.ben-manes.versions") version "0.50.0"
- id("io.gitlab.arturbosch.detekt") version "1.23.3"
- id("java")
- id("maven-publish")
- id("org.jetbrains.dokka") version "1.9.10"
- id("org.jetbrains.kotlinx.kover") version "0.7.4"
- id("org.sonarqube") version "4.4.1.3373"
- id("signing")
- kotlin("jvm") version "1.9.21"
-}
-
-group = "net.thauvin.erik"
-version = "1.1.1-SNAPSHOT"
-description = "A small library for posting to Pinboard"
-
-val gitHub = "ethauvin/$name"
-val mavenUrl = "https://github.com/$gitHub"
-val deployDir = "deploy"
-var isRelease = "release" in gradle.startParameter.taskNames
-
-val publicationName = "mavenJava"
-
-object Versions {
- const val OKHTTP = "4.12.0"
-}
-
-fun isNonStable(version: String): Boolean {
- val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
- val regex = "^[0-9,.v-]+(-r)?$".toRegex()
- val isStable = stableKeyword || regex.matches(version)
- return isStable.not()
-}
-
-repositories {
- mavenCentral()
- maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
-}
-
-dependencies {
- implementation(platform(kotlin("bom")))
-
- implementation("com.squareup.okhttp3:okhttp:${Versions.OKHTTP}")
- implementation("com.squareup.okhttp3:logging-interceptor:${Versions.OKHTTP}")
-
- testImplementation("org.testng:testng:7.8.0")
-}
-
-java {
- sourceCompatibility = JavaVersion.VERSION_11
- targetCompatibility = JavaVersion.VERSION_11
- withSourcesJar()
-}
-
-detekt {
- //toolVersion = "main-SNAPSHOT"
- baseline = project.rootDir.resolve("config/detekt/baseline.xml")
-}
-
-koverReport {
- defaults {
- xml {
- onCheck = true
- }
- html {
- onCheck = true
- }
- }
-}
-
-sonarqube {
- properties {
- property("sonar.projectKey", "ethauvin_$name")
- property("sonar.organization", "ethauvin-github")
- property("sonar.host.url", "https://sonarcloud.io")
- property("sonar.sourceEncoding", "UTF-8")
- property("sonar.coverage.jacoco.xmlReportPaths", "${layout.buildDirectory.get()}/reports/kover/report.xml")
- }
-}
-
-val javadocJar by tasks.creating(Jar::class) {
- dependsOn(tasks.dokkaJavadoc)
- from(tasks.dokkaJavadoc)
- archiveClassifier.set("javadoc")
- description = "Assembles a JAR of the generated Javadoc."
- group = JavaBasePlugin.DOCUMENTATION_GROUP
-}
-
-tasks {
- withType {
- testLogging {
- exceptionFormat = TestExceptionFormat.FULL
- events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
- }
-
- useTestNG()
- }
-
- withType {
- kotlinOptions.jvmTarget = java.targetCompatibility.toString()
- }
-
- withType {
- destination = file("$projectDir/pom.xml")
- }
-
- withType {
- rejectVersionIf {
- isNonStable(candidate.version)
- }
- }
-
- clean {
- doLast {
- project.delete(fileTree(deployDir))
- }
- }
-
- val copyToDeploy by registering(Copy::class) {
- from(configurations.runtimeClasspath) {
- exclude("annotations-*.jar")
- exclude("kotlin-*.jar")
- }
- from(jar)
- into(deployDir)
- }
-
- register("deploy") {
- description = "Copies all needed files to the $deployDir directory."
- group = PublishingPlugin.PUBLISH_TASK_GROUP
- dependsOn(clean, build, jar)
- outputs.dir(deployDir)
- inputs.files(copyToDeploy)
- mustRunAfter(clean)
- }
-
- val gitIsDirty by registering(Exec::class) {
- description = "Fails if git has uncommitted changes."
- group = "verification"
- commandLine("git", "diff", "--quiet", "--exit-code")
- }
-
- val gitTag by registering(Exec::class) {
- description = "Tags the local repository with version ${project.version}"
- group = PublishingPlugin.PUBLISH_TASK_GROUP
- dependsOn(gitIsDirty)
- if (isRelease) {
- commandLine("git", "tag", "-a", project.version, "-m", "Version ${project.version}")
- }
- }
-
- register("release") {
- description = "Publishes version ${project.version} to local repository."
- group = PublishingPlugin.PUBLISH_TASK_GROUP
- dependsOn(wrapper, "deploy", gitTag, publishToMavenLocal)
- }
-}
-
-publishing {
- publications {
- create(publicationName) {
- from(components["java"])
- artifact(javadocJar)
- 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")
- }
- }
- 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:https//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 = if (project.version.toString().contains("SNAPSHOT"))
- uri("https://oss.sonatype.org/content/repositories/snapshots/") else
- uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
- credentials(PasswordCredentials::class)
- }
- }
-}
-
-signing {
- useGpgCmd()
- sign(publishing.publications[publicationName])
-}
diff --git a/deploy.sh b/deploy.sh
deleted file mode 100755
index f7caf5f..0000000
--- a/deploy.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-./gradlew deploy
-[ $? -eq 0 ] && scp deploy/*.jar nix3.thauvin.us:/opt/lib/jtalk-ee/pinboard-poster
diff --git a/examples/bld/.gitignore b/examples/bld/.gitignore
new file mode 100644
index 0000000..a2805aa
--- /dev/null
+++ b/examples/bld/.gitignore
@@ -0,0 +1,55 @@
+.gradle
+.DS_Store
+build
+lib/bld/**
+!lib/bld/bld-wrapper.jar
+!lib/bld/bld-wrapper.properties
+lib/compile/
+lib/runtime/
+lib/standalone/
+lib/test/
+
+# IDEA ignores
+
+# User-specific
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# SonarLint plugin
+.idea/sonarlint/
+
+# Editor-based Rest Client
+.idea/httpRequests
\ No newline at end of file
diff --git a/examples/bld/.idea/.gitignore b/examples/bld/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/examples/bld/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/examples/bld/.idea/.name b/examples/bld/.idea/.name
new file mode 100644
index 0000000..6782949
--- /dev/null
+++ b/examples/bld/.idea/.name
@@ -0,0 +1 @@
+pinboard-poster-examples-bld
\ No newline at end of file
diff --git a/examples/bld/.idea/app.iml b/examples/bld/.idea/app.iml
new file mode 100644
index 0000000..5a2dc51
--- /dev/null
+++ b/examples/bld/.idea/app.iml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.idea/bld.iml b/examples/bld/.idea/bld.iml
new file mode 100644
index 0000000..e63e11e
--- /dev/null
+++ b/examples/bld/.idea/bld.iml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.idea/inspectionProfiles/Project_Default.xml b/examples/bld/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..1e01b48
--- /dev/null
+++ b/examples/bld/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.idea/libraries/bld.xml b/examples/bld/.idea/libraries/bld.xml
new file mode 100644
index 0000000..ca84ff0
--- /dev/null
+++ b/examples/bld/.idea/libraries/bld.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/bld/.idea/libraries/compile.xml b/examples/bld/.idea/libraries/compile.xml
new file mode 100644
index 0000000..9bd86aa
--- /dev/null
+++ b/examples/bld/.idea/libraries/compile.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.idea/libraries/runtime.xml b/examples/bld/.idea/libraries/runtime.xml
new file mode 100644
index 0000000..2ae5c4b
--- /dev/null
+++ b/examples/bld/.idea/libraries/runtime.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.idea/libraries/test.xml b/examples/bld/.idea/libraries/test.xml
new file mode 100644
index 0000000..b80486a
--- /dev/null
+++ b/examples/bld/.idea/libraries/test.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.idea/misc.xml b/examples/bld/.idea/misc.xml
new file mode 100644
index 0000000..542659b
--- /dev/null
+++ b/examples/bld/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.idea/modules.xml b/examples/bld/.idea/modules.xml
new file mode 100644
index 0000000..55adcb9
--- /dev/null
+++ b/examples/bld/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.idea/runConfigurations/Run Tests.xml b/examples/bld/.idea/runConfigurations/Run Tests.xml
new file mode 100644
index 0000000..e5f873f
--- /dev/null
+++ b/examples/bld/.idea/runConfigurations/Run Tests.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.idea/vcs.xml b/examples/bld/.idea/vcs.xml
new file mode 100644
index 0000000..b2bdec2
--- /dev/null
+++ b/examples/bld/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/bld/.vscode/launch.json b/examples/bld/.vscode/launch.json
new file mode 100644
index 0000000..b183bbe
--- /dev/null
+++ b/examples/bld/.vscode/launch.json
@@ -0,0 +1,11 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "java",
+ "name": "Run Tests",
+ "request": "launch",
+ "mainClass": "net.thauvin.erik.pinboard.samples.JavaExampleTest"
+ }
+ ]
+}
diff --git a/examples/bld/.vscode/settings.json b/examples/bld/.vscode/settings.json
new file mode 100644
index 0000000..133aa45
--- /dev/null
+++ b/examples/bld/.vscode/settings.json
@@ -0,0 +1,15 @@
+{
+ "java.project.sourcePaths": [
+ "src/main/java",
+ "src/main/resources",
+ "src/test/java",
+ "src/bld/java"
+ ],
+ "java.configuration.updateBuildConfiguration": "automatic",
+ "java.project.referencedLibraries": [
+ "${HOME}/.bld/dist/bld-1.7.5.jar",
+ "lib/compile/*.jar",
+ "lib/runtime/*.jar",
+ "lib/test/*.jar"
+ ]
+}
diff --git a/examples/bld/README.md b/examples/bld/README.md
new file mode 100644
index 0000000..ad5401c
--- /dev/null
+++ b/examples/bld/README.md
@@ -0,0 +1,18 @@
+## Kotlin Example
+To compile & run the Kotlin example:
+
+```console
+./bld compile
+
+./bld run
+```
+
+## Java Example
+
+To compile & run the Java example:
+
+```console
+./bld compile
+
+./bld run-java
+```
diff --git a/examples/bld/bld b/examples/bld/bld
new file mode 100755
index 0000000..1a39c97
--- /dev/null
+++ b/examples/bld/bld
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+java -jar "$(dirname "$0")/lib/bld/bld-wrapper.jar" "$0" --build net.thauvin.erik.pinboard.samples.ExampleBuild "$@"
diff --git a/examples/bld/bld.bat b/examples/bld/bld.bat
new file mode 100644
index 0000000..6357553
--- /dev/null
+++ b/examples/bld/bld.bat
@@ -0,0 +1,4 @@
+@echo off
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+java -jar "%DIRNAME%/lib/bld/bld-wrapper.jar" "%0" --build net.thauvin.erik.pinboard.samples.ExampleBuild %*
diff --git a/examples/bld/lib/bld/bld-wrapper.jar b/examples/bld/lib/bld/bld-wrapper.jar
new file mode 100644
index 0000000..44b7c9a
Binary files /dev/null and b/examples/bld/lib/bld/bld-wrapper.jar differ
diff --git a/examples/bld/lib/bld/bld-wrapper.properties b/examples/bld/lib/bld/bld-wrapper.properties
new file mode 100644
index 0000000..095b48c
--- /dev/null
+++ b/examples/bld/lib/bld/bld-wrapper.properties
@@ -0,0 +1,7 @@
+bld.downloadExtensionJavadoc=false
+bld.downloadExtensionSources=true
+bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.0-SNAPSHOT
+bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
+bld.downloadLocation=
+bld.sourceDirectories=
+bld.version=1.7.5
diff --git a/examples/bld/src/bld/java/net/thauvin/erik/pinboard/samples/ExampleBuild.java b/examples/bld/src/bld/java/net/thauvin/erik/pinboard/samples/ExampleBuild.java
new file mode 100644
index 0000000..cebc20c
--- /dev/null
+++ b/examples/bld/src/bld/java/net/thauvin/erik/pinboard/samples/ExampleBuild.java
@@ -0,0 +1,52 @@
+package net.thauvin.erik.pinboard.samples;
+
+import rife.bld.BaseProject;
+import rife.bld.BuildCommand;
+import rife.bld.extension.CompileKotlinOperation;
+import rife.bld.operations.RunOperation;
+
+import java.util.List;
+
+import static rife.bld.dependencies.Repository.*;
+import static rife.bld.dependencies.Scope.compile;
+
+public class ExampleBuild extends BaseProject {
+ public ExampleBuild() {
+ pkg = "net.thauvin.erik.pinboard.samples";
+ name = "Example";
+ version = version(0, 1, 0);
+
+ mainClass = pkg + ".KotlinExampleKt";
+
+ javaRelease = 11;
+ downloadSources = true;
+ autoDownloadPurge = true;
+
+ repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);
+
+ scope(compile)
+ .include(dependency("net.thauvin.erik", "pinboard-poster", version(1, 1, 1, "SNAPSHOT")));
+ }
+
+ public static void main(String[] args) {
+ new ExampleBuild().start(args);
+ }
+
+ @Override
+ public void compile() throws Exception {
+ new CompileKotlinOperation()
+ .fromProject(this)
+ .execute();
+
+ // Also compile the Java source code
+ super.compile();
+ }
+
+ @BuildCommand(value = "run-java", summary = "Runs the Java example")
+ public void runJava() throws Exception {
+ new RunOperation()
+ .fromProject(this)
+ .mainClass(pkg + ".JavaExample")
+ .execute();
+ }
+}
diff --git a/samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java b/examples/bld/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
similarity index 100%
rename from samples/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
rename to examples/bld/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
diff --git a/samples/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt b/examples/bld/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
similarity index 100%
rename from samples/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
rename to examples/bld/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
diff --git a/samples/java/.editorconfig b/examples/gradle/java/.editorconfig
similarity index 100%
rename from samples/java/.editorconfig
rename to examples/gradle/java/.editorconfig
diff --git a/samples/java/.gitignore b/examples/gradle/java/.gitignore
similarity index 100%
rename from samples/java/.gitignore
rename to examples/gradle/java/.gitignore
diff --git a/examples/gradle/java/.idea/.gitignore b/examples/gradle/java/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/examples/gradle/java/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/examples/gradle/java/.idea/.name b/examples/gradle/java/.idea/.name
new file mode 100644
index 0000000..4f5dba1
--- /dev/null
+++ b/examples/gradle/java/.idea/.name
@@ -0,0 +1 @@
+pinboard-poster-examples-gradle-java
\ No newline at end of file
diff --git a/.idea/encodings.xml b/examples/gradle/java/.idea/compiler.xml
similarity index 50%
rename from .idea/encodings.xml
rename to examples/gradle/java/.idea/compiler.xml
index 97626ba..fb7f4a8 100644
--- a/.idea/encodings.xml
+++ b/examples/gradle/java/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
-
+
+
\ No newline at end of file
diff --git a/examples/gradle/java/.idea/inspectionProfiles/Project_Default.xml b/examples/gradle/java/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..1e01b48
--- /dev/null
+++ b/examples/gradle/java/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/examples/gradle/java/.idea/jarRepositories.xml
similarity index 53%
rename from .idea/jarRepositories.xml
rename to examples/gradle/java/.idea/jarRepositories.xml
index 646928b..a529ef2 100644
--- a/.idea/jarRepositories.xml
+++ b/examples/gradle/java/.idea/jarRepositories.xml
@@ -16,30 +16,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/gradle/java/.idea/misc.xml b/examples/gradle/java/.idea/misc.xml
new file mode 100644
index 0000000..65c5674
--- /dev/null
+++ b/examples/gradle/java/.idea/misc.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/gradle/java/.idea/vcs.xml b/examples/gradle/java/.idea/vcs.xml
new file mode 100644
index 0000000..c2365ab
--- /dev/null
+++ b/examples/gradle/java/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/gradle/java/README.md b/examples/gradle/java/README.md
new file mode 100644
index 0000000..caf0563
--- /dev/null
+++ b/examples/gradle/java/README.md
@@ -0,0 +1,5 @@
+## Run the Example
+
+```console
+./gradlew run
+```
diff --git a/samples/java/build.gradle b/examples/gradle/java/build.gradle
similarity index 96%
rename from samples/java/build.gradle
rename to examples/gradle/java/build.gradle
index 5cd38df..3cf126d 100644
--- a/samples/java/build.gradle
+++ b/examples/gradle/java/build.gradle
@@ -4,8 +4,6 @@ plugins {
id 'application'
}
-// ./gradlew run
-
defaultTasks 'run'
mainClassName = 'net.thauvin.erik.pinboard.samples.JavaExample'
diff --git a/gradle/wrapper/gradle-wrapper.jar b/examples/gradle/java/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
rename from gradle/wrapper/gradle-wrapper.jar
rename to examples/gradle/java/gradle/wrapper/gradle-wrapper.jar
diff --git a/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/java/gradle/wrapper/gradle-wrapper.properties
similarity index 100%
rename from gradle/wrapper/gradle-wrapper.properties
rename to examples/gradle/java/gradle/wrapper/gradle-wrapper.properties
diff --git a/gradlew b/examples/gradle/java/gradlew
similarity index 100%
rename from gradlew
rename to examples/gradle/java/gradlew
diff --git a/gradlew.bat b/examples/gradle/java/gradlew.bat
similarity index 100%
rename from gradlew.bat
rename to examples/gradle/java/gradlew.bat
diff --git a/samples/java/settings.gradle b/examples/gradle/java/settings.gradle
similarity index 100%
rename from samples/java/settings.gradle
rename to examples/gradle/java/settings.gradle
diff --git a/examples/gradle/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java b/examples/gradle/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
new file mode 100644
index 0000000..881ff7f
--- /dev/null
+++ b/examples/gradle/java/src/main/java/net/thauvin/erik/pinboard/samples/JavaExample.java
@@ -0,0 +1,47 @@
+package net.thauvin.erik.pinboard.samples;
+
+import net.thauvin.erik.pinboard.PinConfig;
+import net.thauvin.erik.pinboard.PinboardPoster;
+
+import java.nio.file.Paths;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class JavaExample {
+ public static void main(String[] args) {
+ final String url = "https://example.com/pinboard";
+ final PinboardPoster poster;
+
+ if (args.length == 1) {
+ // API Token is an argument
+ poster = new PinboardPoster(args[0]);
+ } else {
+ // API Token is in local.properties or PINBOARD_API_TOKEN environment variable
+ poster = new PinboardPoster(Paths.get("local.properties"));
+ }
+
+ // Set logging levels
+ final ConsoleHandler consoleHandler = new ConsoleHandler();
+ consoleHandler.setLevel(Level.FINE);
+ final Logger logger = poster.getLogger();
+ logger.addHandler(consoleHandler);
+ logger.setLevel(Level.FINE);
+ logger.setUseParentHandlers(false);
+
+ // Add Pin
+ if (poster.addPin(new PinConfig.Builder()
+ .url(url)
+ .description("Testing")
+ .extended("Extra")
+ .tags("test", "java")
+ .build())) {
+ System.out.println("Added: " + url);
+ }
+
+ // Delete Pin
+ if (poster.deletePin(url)) {
+ System.out.println("Deleted: " + url);
+ }
+ }
+}
diff --git a/samples/kotlin/.editorconfig b/examples/gradle/kotlin/.editorconfig
similarity index 100%
rename from samples/kotlin/.editorconfig
rename to examples/gradle/kotlin/.editorconfig
diff --git a/samples/kotlin/.gitignore b/examples/gradle/kotlin/.gitignore
similarity index 100%
rename from samples/kotlin/.gitignore
rename to examples/gradle/kotlin/.gitignore
diff --git a/examples/gradle/kotlin/.idea/.gitignore b/examples/gradle/kotlin/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/examples/gradle/kotlin/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/examples/gradle/kotlin/.idea/.name b/examples/gradle/kotlin/.idea/.name
new file mode 100644
index 0000000..91c6ff0
--- /dev/null
+++ b/examples/gradle/kotlin/.idea/.name
@@ -0,0 +1 @@
+pinboard-poster-examples-gradle-kotlin
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/compiler.xml b/examples/gradle/kotlin/.idea/compiler.xml
new file mode 100644
index 0000000..fb7f4a8
--- /dev/null
+++ b/examples/gradle/kotlin/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/inspectionProfiles/Project_Default.xml b/examples/gradle/kotlin/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..1e01b48
--- /dev/null
+++ b/examples/gradle/kotlin/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/jarRepositories.xml b/examples/gradle/kotlin/.idea/jarRepositories.xml
new file mode 100644
index 0000000..a529ef2
--- /dev/null
+++ b/examples/gradle/kotlin/.idea/jarRepositories.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/kotlinc.xml b/examples/gradle/kotlin/.idea/kotlinc.xml
new file mode 100644
index 0000000..ae3f30a
--- /dev/null
+++ b/examples/gradle/kotlin/.idea/kotlinc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/misc.xml b/examples/gradle/kotlin/.idea/misc.xml
new file mode 100644
index 0000000..65c5674
--- /dev/null
+++ b/examples/gradle/kotlin/.idea/misc.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/gradle/kotlin/.idea/vcs.xml b/examples/gradle/kotlin/.idea/vcs.xml
new file mode 100644
index 0000000..c2365ab
--- /dev/null
+++ b/examples/gradle/kotlin/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/gradle/kotlin/README.md b/examples/gradle/kotlin/README.md
new file mode 100644
index 0000000..caf0563
--- /dev/null
+++ b/examples/gradle/kotlin/README.md
@@ -0,0 +1,5 @@
+## Run the Example
+
+```console
+./gradlew run
+```
diff --git a/samples/kotlin/build.gradle.kts b/examples/gradle/kotlin/build.gradle.kts
similarity index 92%
rename from samples/kotlin/build.gradle.kts
rename to examples/gradle/kotlin/build.gradle.kts
index 31dbfe4..151e355 100644
--- a/samples/kotlin/build.gradle.kts
+++ b/examples/gradle/kotlin/build.gradle.kts
@@ -3,11 +3,9 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("application")
id("com.github.ben-manes.versions") version "0.50.0"
- kotlin("jvm") version "1.9.10"
+ kotlin("jvm") version "1.9.21"
}
-// ./gradlew run
-
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
repositories {
diff --git a/samples/java/gradle/wrapper/gradle-wrapper.jar b/examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
rename from samples/java/gradle/wrapper/gradle-wrapper.jar
rename to examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.jar
diff --git a/samples/java/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.properties
similarity index 100%
rename from samples/java/gradle/wrapper/gradle-wrapper.properties
rename to examples/gradle/kotlin/gradle/wrapper/gradle-wrapper.properties
diff --git a/samples/java/gradlew b/examples/gradle/kotlin/gradlew
similarity index 100%
rename from samples/java/gradlew
rename to examples/gradle/kotlin/gradlew
diff --git a/samples/java/gradlew.bat b/examples/gradle/kotlin/gradlew.bat
similarity index 100%
rename from samples/java/gradlew.bat
rename to examples/gradle/kotlin/gradlew.bat
diff --git a/samples/kotlin/settings.gradle.kts b/examples/gradle/kotlin/settings.gradle.kts
similarity index 100%
rename from samples/kotlin/settings.gradle.kts
rename to examples/gradle/kotlin/settings.gradle.kts
diff --git a/examples/gradle/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt b/examples/gradle/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
new file mode 100644
index 0000000..0582144
--- /dev/null
+++ b/examples/gradle/kotlin/src/main/kotlin/net/thauvin/erik/pinboard/samples/KotlinExample.kt
@@ -0,0 +1,34 @@
+package net.thauvin.erik.pinboard.samples
+
+import net.thauvin.erik.pinboard.PinboardPoster
+import java.nio.file.Paths
+import java.util.logging.ConsoleHandler
+import java.util.logging.Level
+
+fun main(args: Array) {
+ val url = "https://example.com/pinboard"
+
+ val poster = if (args.size == 1) {
+ // API Token is an argument
+ PinboardPoster(args[0])
+ } else {
+ // API Token is in local.properties or PINBOARD_API_TOKEN environment variable
+ PinboardPoster(Paths.get("local.properties"))
+ }
+
+ // Set logging levels
+ with(poster.logger) {
+ addHandler(ConsoleHandler().apply { level = Level.FINE })
+ level = Level.FINE
+ }
+
+ // Add Pin
+ if (poster.addPin(url, "Testing", "Extended test", tags = arrayOf("test", "kotlin"))) {
+ println("Added: $url")
+ }
+
+ // Delete Pin
+ if (poster.deletePin(url)) {
+ println("Deleted: $url")
+ }
+}
diff --git a/gradle.properties b/gradle.properties
deleted file mode 100644
index e69de29..0000000
diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar
new file mode 100644
index 0000000..0690b8c
Binary files /dev/null and b/lib/bld/bld-wrapper.jar differ
diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties
new file mode 100644
index 0000000..ff9973f
--- /dev/null
+++ b/lib/bld/bld-wrapper.properties
@@ -0,0 +1,8 @@
+bld.downloadExtensionJavadoc=false
+bld.downloadExtensionSources=true
+bld.extension.jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.1
+bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.0-SNAPSHOT
+bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
+bld.downloadLocation=
+bld.sourceDirectories=
+bld.version=1.7.5
diff --git a/pinboard-poster.iml b/pinboard-poster.iml
deleted file mode 100644
index 6afc535..0000000
--- a/pinboard-poster.iml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-