Compare commits

...

227 commits

Author SHA1 Message Date
1c9a5191ce
Fix typo 2025-03-26 12:31:00 -07:00
a9cb103cdb
Add snapshot repository 2025-03-26 12:07:26 -07:00
1e5f088639
Cleanup compile command 2025-03-26 12:02:45 -07:00
0ea3fd0520
Add OS matrix for Ubuntu, Windows and macOS 2025-03-26 11:59:03 -07:00
28aebbabfa
IDEA project update 2025-03-26 11:58:46 -07:00
771e2fb208
Add extensions logging 2025-03-26 11:58:20 -07:00
53defaedb3
Update to latest snapshots 2025-03-26 11:57:29 -07:00
3cac9171fd
Add Kotlin example compile options for JDK 24 2025-03-20 21:36:17 -07:00
6510b2b6b3
Combine Kotlin compile options 2025-03-20 20:36:06 -07:00
f8cbab5e87
1.2.1-Add Kotlin compile options for JDK 24 2025-03-20 09:40:34 -07:00
221fa19b94
1.2.1-SNAPSHOT 2025-03-20 09:40:08 -07:00
12b4a80296
Bump Kotlin to version 2.1.20 2025-03-20 09:39:50 -07:00
f582a1e2c1
JDK 24 2025-03-18 23:56:56 -07:00
4b741538ad
Add Junit Platform Launcher dependency 2025-03-18 04:22:11 -07:00
fdb587c716
Update Java/Kotlin to more recent versions 2025-03-16 21:16:51 -07:00
8ebcca5bfe
Version 1.0.0 2025-03-16 20:10:17 -07:00
a748e4139c
Update copyright 2025-03-16 19:55:13 -07:00
34f8fc8fed
Add project icon 2025-03-16 19:54:22 -07:00
0bad2bf332
Bump JUnit to version 5.12.1 2025-03-16 19:54:09 -07:00
81d628a021
Update dependencies
Bump Detekt to extension version 0.9.9
Bump Dokka to extension version 1.0.3
Bump Jacco Report extension to version 0.9.9
2025-03-16 19:53:23 -07:00
a4ac975051
Bump Kotlin to version 2.1.10 2025-03-16 19:51:55 -07:00
36996f36fe
Bump Gradle to version 8.13 2025-03-16 19:50:30 -07:00
8e64ad8c4a
Bump bld to version 2.2.1 2025-03-16 19:49:11 -07:00
fed9a5ca3f
Updated dependencies
Bumped Kotlin to version 2.1.0
Bumped Kotlin extension to version 1.0.3
Bumped Dokka extension to version 1.0.2
Bumped Gradle to version 8.12
Bumped JUnit to version 5.11.4
2024-12-22 15:21:53 -08:00
86ae130748
Updated copyright 2024-09-21 12:51:17 -07:00
19f21f22dc
Updated dependencies
Bumped bld to version 2.1.0
Bumped Gradle to version 8.10.1
Bumped Kotlin to version 2.0.20
Bumped JUnit to version 5.11.0
2024-09-21 12:31:57 -07:00
c41f1f3b2e
Bumped Gradle to version 8.8 2024-06-04 22:02:46 -07:00
bca19736cf
Bumped Kotlin extension to version 0.9.8 2024-05-27 18:05:34 -07:00
8de0330b91
Made config constructor private 2024-05-26 00:35:18 -07:00
9036a32239
Reworked PinConfig with required parameters, etc. 2024-05-25 15:34:40 -07:00
0f9606391e
Bumped Kotlin to version 2.0.0 2024-05-25 15:33:20 -07:00
8e05823153
Minor cleanup 2024-05-10 11:37:29 -07:00
6bef05c7de
Bumped JaCoCo to version 0.9.3 2024-05-10 11:31:32 -07:00
b2b0540e39
Bumped Kotlin to version 1.9.24 2024-05-10 11:30:10 -07:00
154bcccc9c
Bumped bld to version 1.9.1
Bumped Grade to version 8.7
2024-05-10 11:24:54 -07:00
ab87916f16
Bumped workflow actions to latest versions 2024-05-10 11:19:24 -07:00
f01ed318f9
Bumped bld to 1.9.0 2024-03-21 00:23:10 -07:00
fecf40457a
Bumped dependencies 2024-03-21 00:23:10 -07:00
dd2dff89b4
Added contributing section 2024-03-21 00:23:10 -07:00
0f01084405
Bumped dependencies 2024-03-21 00:23:10 -07:00
4274930988
Bumped bld to 1.8.0 2024-03-21 00:23:04 -07:00
c9d4ec46df Updated version in README 2023-11-26 00:39:53 -08:00
e7a6b3481c Version 1.1.1 2023-11-26 00:29:39 -08:00
0a9de8d863 Added detekt extension 2023-11-25 21:34:06 -08:00
5128916fa1 Made validate function public 2023-11-24 07:29:23 -08:00
8c3687591d Fixed sonar project properties 2023-11-24 00:46:24 -08:00
61e31b9acf Cleaned up tests 2023-11-24 00:31:30 -08:00
7286c60bd5 Fixed GitHub CI badge 2023-11-23 23:25:18 -08:00
77e48291ba Added pinboard token to workflow 2023-11-23 23:21:09 -08:00
3fa34848f5 Moved from Gradle to bld 2023-11-23 23:15:24 -08:00
594ca811e3 Upgraded to Kotlin 1.9.21 2023-11-23 18:01:01 -08:00
00f78b7575 Updated examples current snapshot dependencies 2023-10-18 21:51:53 -07:00
d57070bc59 Updated dependencies 2023-10-18 21:44:45 -07:00
0202ca0be6 Java 20 deprecation cleanup 2023-10-18 21:44:11 -07:00
52106f896d Version 1.1 2023-09-27 19:42:51 -07:00
e056220257 Cleanup before 1.1 release 2023-09-27 18:46:40 -07:00
fd7d97cfd9 Merge branch '1.0.4-dev' 2023-09-27 18:29:19 -07:00
ca6e0e2f0f Minor cleanup 2023-09-27 18:06:36 -07:00
fc77b73399 Added pin config builder. Closes #10 2023-09-27 17:25:00 -07:00
045ad0f276 Updated dependencies 2023-09-27 17:25:00 -07:00
628481606c Fixed potential resource leak. Closes #11 2023-09-27 17:24:48 -07:00
1e2f2ccee9 Upgraded to Kotlin 1.7.20 2022-09-30 22:45:46 -07:00
56fa17703c Updated dependencies 2022-04-29 12:39:59 -07:00
c48a9c902e Updated dependencies and copyright. 2022-01-03 12:15:42 -08:00
8673b17ed5 Cleaned up null handling. 2022-01-03 12:15:11 -08:00
2f9ab9a4cf Updated examples (Kotlin 1.5.31, JDK 1.8) 2021-10-01 23:08:41 -07:00
2cd3b9cd61 Upgraded to Kotlin 1.5.31 and JDK 17. 2021-10-01 22:39:53 -07:00
3dd75fa575 Upgrade to JDK 16 and Kotlin 1.3.21 2021-07-27 15:10:13 -07:00
972d93c4b1 Updated dependencies. 2021-07-08 10:33:53 -07:00
7335f7d6b1 Added Github workflow martix for JDK 1.8, 11 & 15. 2021-05-31 11:54:30 -07:00
ba4a374853 Replaced List of pairs with Map. 2021-05-23 12:30:14 -07:00
5ed71cb447 Added random URL for testing. 2021-05-21 14:06:03 -07:00
b5307a0a02 Using system wide Gradle and increased metaspace. 2021-05-21 13:01:00 -07:00
033e063103 Removed TravisCI. 2021-05-20 21:40:38 -07:00
f548b4ce5b Moved Sonarqube to GitHub action. 2021-05-19 20:54:39 -07:00
2bb7c4db63 Fix for Gitlab CI 2021-05-11 21:52:08 -07:00
50b2e93718 Upgraded to Gradle 7.0.1 2021-05-11 21:05:06 -07:00
392b167e77 Cleanup. 2021-05-09 15:04:42 -07:00
563af5b436 Added support for snapshot. 2021-05-02 20:33:55 -07:00
b984f54a8d Updated dependencies. 2021-05-02 14:13:21 -07:00
65c736cc23 Improved excepetions handling. 2021-05-02 14:13:12 -07:00
2ff60e434c Using Jacoco snapshot. 2021-04-28 20:04:44 -07:00
22e23c63e5 Upgraded to Kotlin 1.5.0 2021-04-28 12:13:41 -07:00
a27b5fa6eb Updated for 1.0.3 2021-03-21 22:50:21 -07:00
0f359f5ad9 Updated version numbers. 2021-03-21 22:46:12 -07:00
4059c4388d Should be compiled for Java 8, not 15. Closes #4. 2021-03-21 22:36:24 -07:00
42af1133e9 Merge branch '1.0.2' 2021-03-21 21:58:15 -07:00
b2ffa4fddc Fixed maven central badge. 2021-03-21 21:42:37 -07:00
a00d1a0987 Cleanup. 2021-03-21 21:22:09 -07:00
5675995bbe Fixed typo. 2021-03-21 21:09:47 -07:00
196d497003 Updated version numbers to 1.0.2 since the new pinboard API is not quite ready. 2021-03-21 21:08:30 -07:00
2d20d0292d Updated copyright. 2021-03-21 18:41:09 -07:00
026456218e Added jdk14 to CIs. 2021-03-21 18:27:31 -07:00
e60303773a Updated versions. 2021-03-21 18:19:44 -07:00
8eb6847aad Moved from JCenter to Maven Central.
Updated dependencies.
2021-03-21 17:54:34 -07:00
c08cb0708d Removed Kobalt. 2020-08-19 21:15:58 -07:00
d3b6fb50d1 Catch all IOExceptions in executeMethod. Closes #2 2020-08-19 16:41:45 -07:00
505eee98f0 Implemented using HttpLoggingInterceptor instead of manual logging. Closes #3. 2020-08-19 16:29:46 -07:00
411e63a0ba Added trusty dist. 2020-08-18 12:04:15 -07:00
0f0e87bb6a Upgraded to Gradle 6.6 and Kotlin 1.4.0. 2020-08-18 11:39:40 -07:00
4f458b0bdc Updated for 1.0.1 2019-05-26 21:24:53 -07:00
4029a6991e okhttp dependency update. 2019-05-26 21:21:09 -07:00
3565219178 Update references to 1.0.1. 2019-05-26 21:11:52 -07:00
ad264a2da2 Misc. IDEA files updates. 2019-05-26 21:07:38 -07:00
18fd631d91 Updated baseline. 2019-05-26 20:59:12 -07:00
f820434211 Code cleanup. 2019-05-26 20:58:41 -07:00
dfb60096e9 Fixed kotlin example. 2019-05-26 20:35:47 -07:00
f39020b276 Suppress member visibility on logger field. 2019-05-26 20:35:28 -07:00
a96c113825 Ignore stderr stream. 2019-05-26 20:34:36 -07:00
462c0813bf Made parseMethodResponse() internal. 2019-05-26 18:13:20 -07:00
df70a795b8 Updated wrappers. 2019-05-26 18:12:48 -07:00
652bc83a6a Dependencies updates. 2019-04-24 00:42:57 -07:00
00249bd87f 1.1.4 2019-04-24 00:42:16 -07:00
8cd291309e Updated wrappers. 2019-04-24 00:42:01 -07:00
925f3fca08 Updated copryright. 2019-04-24 00:41:49 -07:00
e57c7e8387 Duh. 2019-04-24 00:35:56 -07:00
5bc1a0f1b3 Added change log. 2019-04-23 23:00:36 -07:00
ffa77803f8 Switched to Kotlin 1.3.30 and cleanup. 2019-04-22 23:52:21 -07:00
10ca47fc08 Added build scan support. 2019-04-13 04:49:07 -07:00
fbcd681da7 Added example script. 2019-04-13 04:48:46 -07:00
1093ea1625 Implemented parseMethodResponse. 2019-04-13 04:48:30 -07:00
6410c5558f Version 1.0.1 2019-04-06 00:09:16 -07:00
bc1eee283f Removed kobalt. 2019-04-06 00:09:06 -07:00
1d7c469e71 Added version. 2019-04-05 23:51:00 -07:00
bd95e50d01 Removed kobalt. 2019-04-05 23:17:56 -07:00
7f00f9b185 Added script to updat wrappers. 2019-04-04 15:48:54 -07:00
08868de3d7 Fix test for CI. 2019-04-04 15:31:39 -07:00
3e71a1216e Updated wrapper. 2019-04-04 15:31:18 -07:00
3dc0f2902e Added more constructors tests. 2019-04-04 10:36:17 -07:00
b9e4ab4cd1 Added jacoco tool version. 2019-04-04 00:01:21 -07:00
f5f4a5cd8d Fixed jacoco reports. 2019-04-03 23:35:20 -07:00
aaa43c106e Added sonarcloud. 2019-04-02 16:06:13 -07:00
23bc65aa1b Added sonarcloud badge. 2019-04-02 15:54:07 -07:00
87cc1adefd Added sonarcloud configuration. 2019-04-02 15:53:30 -07:00
ba4cc22f25 Dependencies and syntax updates. 2019-03-15 13:30:09 -07:00
bca09bbfce Removed stable publishing. 2019-03-15 13:16:08 -07:00
6d8a2c17b3 Newlines and spacing fixes. 2019-03-15 13:15:52 -07:00
403f9a8f5f Gradle wrappers update. 2019-03-15 13:14:22 -07:00
b80533cfec IDEA update. 2019-03-15 13:13:28 -07:00
22eb448dd0 Added vcs. 2018-07-11 15:27:01 -07:00
fd7d31775a Fixed detekt warnings. 2018-07-11 15:26:43 -07:00
969768ff73 Added detekt plugin. 2018-07-11 15:25:51 -07:00
1f0d84896a Added editor config. 2018-07-11 15:25:07 -07:00
7ef125db3b Added klint checks. 2018-06-30 23:27:34 -07:00
aed7e8434f Fixed directory name typo. 2018-06-28 10:16:17 -07:00
e3dc6af9b1 Now using git diff for gitIsDirty task. 2018-06-28 09:24:06 -07:00
856a3688c0 Fixed isRelease flag. 2018-06-26 14:38:40 -07:00
33aa824ad9 Fixed kDoc. 2018-06-26 13:55:16 -07:00
e609171681 Updated dependencies. 2018-06-26 13:54:59 -07:00
42efaba8a7 Added LinkMapping to Dokka. 2018-06-26 12:41:22 -07:00
e30e4b7003 Fixed kDoc. 2018-06-26 12:41:02 -07:00
d7f55283d3 Release description fix. 2018-06-25 17:29:37 -07:00
b709c9e5f7 Revert "Testing with git index refresh included in gitIsDirty."
This reverts commit 13455e94f6.
2018-06-25 17:27:11 -07:00
13455e94f6 Testing with git index refresh included in gitIsDirty. 2018-06-25 17:24:27 -07:00
1c13daeb6e Added gitRefreshIndex task. 2018-06-25 17:12:05 -07:00
e2357e9c2a Added release var. 2018-06-25 16:45:02 -07:00
78f6ba7842 Added mustRunAfter to release tassk. 2018-06-25 15:17:54 -07:00
22f936ed7a Fixed gitIsDirty task. 2018-06-25 15:13:24 -07:00
06fb8d5f9c Added release task description. 2018-06-25 15:06:56 -07:00
528ee76f70 Added check for dirty worktree in Git. 2018-06-25 15:02:55 -07:00
d14fb67efd Removed unused imports. 2018-06-22 17:42:25 -07:00
97423807b9 Pre-1.0.0 release. 2018-06-22 17:16:54 -07:00
5c4ec02c42 Added loading of local.properties.
Added pom.xml generation (for snyk, etc.)
Added Grade buildscan.
2018-06-22 17:16:39 -07:00
98ad78ad29 Removed unused import. 2018-06-22 17:14:38 -07:00
329e1ac440 Added KDoc package description. 2018-06-22 17:14:19 -07:00
97c6166ea5 Added stable publsihing feature. 2018-06-22 17:13:28 -07:00
189344db37 Added issueManagement to pom.
Removed application tasks (moved to samples).
2018-06-21 11:28:51 -07:00
bf804992e9 Added Kobalt build for Kotlin example. 2018-06-20 15:39:51 -07:00
0f44c9fa27 Pre-1.0.0 release prep. 2018-06-20 15:39:27 -07:00
483f794966 Fixed typo. 2018-06-20 15:37:00 -07:00
40a43498af Added Kobalt back to CircleCI. 2018-06-20 10:57:18 -07:00
7cfdec0f41 Cleanup. 2018-06-20 10:56:34 -07:00
b55f798142 Made wrappers executable. 2018-06-20 00:54:05 -07:00
0cd0b5bca5 Fixed Gradle wrappers. 2018-06-20 00:47:22 -07:00
92ce560dea Fixed CIs. 2018-06-20 00:42:56 -07:00
5eb413bf4a Fixed examples links. 2018-06-20 00:25:47 -07:00
a91e162aba Added samples. 2018-06-20 00:07:55 -07:00
241cbd8cd4 IDEA files update. 2018-06-20 00:07:37 -07:00
b785c7d0b9 Now using Gradle for CI. 2018-06-20 00:07:11 -07:00
878f8568cf Added generatePom task. 2018-06-20 00:06:24 -07:00
1e70734c13 Added default taks programmatically. 2018-06-20 00:05:57 -07:00
a25901fd6b Added modules for samples. 2018-06-19 20:38:27 -07:00
e865c4e2df Added Gradle build. 2018-06-19 20:37:51 -07:00
6b83c74322 Added KDoc documentation. 2018-06-19 20:37:20 -07:00
3c3a21a05f Moved examples to samples. 2018-06-19 20:36:41 -07:00
d8b476ad97 Fixed badges. 2018-06-18 19:30:28 -07:00
21b37054da Testing with -source. 2018-01-17 11:28:10 -08:00
7cf80e71c8 Added snyk badge. 2018-01-16 20:48:36 -08:00
d6b5b2c931 Kobalt 1.0.100 update. 2018-01-16 14:33:13 -08:00
961167daee Moved to Gemasium since VersionEye is shutting down. 2018-01-16 14:32:39 -08:00
96695c8bfd Updated copyright. 2018-01-16 14:31:06 -08:00
dedb3a4ad4 Fixed examples links. 2017-11-08 23:04:20 -08:00
292e313b44 Version 0.9.3 2017-11-08 22:30:04 -08:00
7cc91b52f1 Kobalt wrapper update. 2017-11-08 22:10:06 -08:00
b4d411726f Added constructor to specify a property file path directly. 2017-11-08 22:09:20 -08:00
95428c22f8 Fixed example. 2017-11-08 20:10:48 -08:00
7c7c33b716 Fixed local property syntax. 2017-11-08 20:04:02 -08:00
169bab65f9 Renamed. 2017-11-08 17:52:36 -08:00
f74ebf3d0c Added license. 2017-11-08 17:47:56 -08:00
7826fbb2e5 Version update. 2017-11-08 11:37:58 -08:00
5317ea2615 Kobalt update to 1.0.91. 2017-11-08 10:55:50 -08:00
e857d3d3aa Added retrieving API token from a local property or environment variable. 2017-11-08 01:03:22 -08:00
87357f5127 Added tests to build. 2017-11-07 12:12:42 -08:00
2521edba46 Reformat. 2017-11-04 12:11:27 -07:00
a7ec86d274 Merge remote-tracking branch 'github/master' 2017-11-04 12:09:21 -07:00
8dc8b093a4 Added Kobalt test wrapper. 2017-11-04 12:05:47 -07:00
1d36d78bf4 Added getting Pinboard API token from (CircleCI) environment variable. 2017-11-04 00:21:24 -07:00
1cfda5f72b Added test for token missing ':' 2017-10-30 15:46:36 -07:00
87c70329d1 Fixed apiToken validation, blank OR not contains ':' 2017-10-30 15:46:10 -07:00
f2c3cdca73 Fixed syntax. 2017-10-30 15:45:27 -07:00
f41f6c8847 Fixed typos. 2017-10-30 15:44:44 -07:00
8b2d267b54 Update dependencies. 2017-10-30 15:27:50 -07:00
b9714a067d Added tests. 2017-10-30 15:23:10 -07:00
423d8494c2 Exposed apiToken. 2017-10-30 15:22:50 -07:00
e2bb3c0a3d Fixed typo. 2017-10-29 23:51:58 -07:00
78bb7ff692 Added check versions. 2017-10-29 23:50:22 -07:00
100abf678a Removed CircleCI 1.0 configuration. 2017-10-29 22:58:32 -07:00
f9ebaa9024 Made kobaltw executable via: 'git update-index --chmod=+x koblatw' 2017-10-29 22:51:03 -07:00
af364847f0 Fixed spacing. 2017-10-29 22:47:50 -07:00
0b7837d929 Added CircleCI 2.0 configuration. 2017-10-29 22:40:09 -07:00
7e5ac30e16 Kobalt and libraries updates. 2017-10-10 20:57:58 -07:00
008ab49b61 Fixed badges. 2017-06-07 21:10:18 -07:00
459b1e5a9b Fixed Gradle instructions. 2017-06-02 15:12:55 -07:00
c78f43280f Added release badge. 2017-05-30 15:26:57 -07:00
15b9772f5f Added circleci configuration. 2017-05-29 19:24:54 -07:00
36bf4794db Cleanup. 2017-05-18 16:32:52 -07:00
166a760716 Updated kotlin logging example link. 2017-05-17 18:38:16 -07:00
112 changed files with 2921 additions and 700 deletions

62
.circleci/config.yml Normal file
View file

@ -0,0 +1,62 @@
version: 2.1
orbs:
sdkman: joshdholtz/sdkman@0.2.0
defaults: &defaults
working_directory: ~/repo
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
CI_NAME: "CircleCI"
commands:
build_and_test:
parameters:
reports-dir:
type: string
default: "build/reports/test_results"
steps:
- checkout
- sdkman/setup-sdkman
- sdkman/sdkman-install:
candidate: kotlin
version: 2.1.10
- run:
name: Download dependencies
command: ./bld download
- run:
name: Compile source
command: ./bld compile
- run:
name: Run tests
command: ./bld jacoco -reports-dir=<< parameters.reports-dir >>
- store_test_results:
path: << parameters.reports-dir >>
- store_artifacts:
path: build/reports/jacoco/test/html
jobs:
bld_jdk17:
<<: *defaults
docker:
- image: cimg/openjdk:17.0
steps:
- build_and_test
bld_jdk21:
<<: *defaults
docker:
- image: cimg/openjdk:21.0
steps:
- build_and_test
workflows:
bld:
jobs:
- bld_jdk17
- bld_jdk21

2
.editorconfig Normal file
View file

@ -0,0 +1,2 @@
[*]
insert_final_newline=true

74
.github/workflows/bld.yml vendored Normal file
View file

@ -0,0 +1,74 @@
name: bld-ci
on: [ push, pull_request, workflow_dispatch ]
env:
COVERAGE_JDK: "21"
COVERAGE_KOTLIN: "2.1.20"
PINBOARD_API_TOKEN: ${{ secrets.PINBOARD_API_TOKEN }}
jobs:
build-bld-project:
strategy:
matrix:
java-version: [ 17, 21, 24 ]
kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }} with Kotlin ${{ matrix.kotlin-version }}
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- name: Download dependencies [bld example]
working-directory: examples/bld
run: ./bld download
- name: Compile and run [bld examples]
working-directory: examples/bld
run: |
./bld compile run
./bld run-java
- name: Run example [gradle java example]
working-directory: examples/gradle/java
if: matrix.java-version != '24'
run: |
./gradlew run
- name: Run example [gradle kotlin example]
working-directory: examples/gradle/kotlin
if: matrix.java-version != '24'
run: |
./gradlew run
- name: Download dependencies
run: ./bld download
- name: Compile source
run: ./bld compile
- name: Run tests
run: ./bld jacoco
- name: Remove pom.xml
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
&& matrix.os == 'ubuntu-latest'
run: rm -rf pom.xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
if: success() && matrix.java-version == env.COVERAGE_JDK && matrix.kotlin-version == env.COVERAGE_KOTLIN
&& matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View file

@ -0,0 +1 @@
future-release=1.1.0

85
.gitignore vendored
View file

@ -1,29 +1,58 @@
**/.idea/dictionaries
**/.idea/gradle.xml
**/.idea/libraries
**/.idea/tasks.xml
**/.idea/workspace.xml
*.sublime-*
*.iws
.classpath
.DS_Store
.gradle
.kobalt
.nb-gradle
.project
.settings
/bin
/build
/deploy
/dist
/gen
/gradle.properties
/local.properties
/out
/proguard-project.txt
/project.properties
/target
/test-output
ehthumbs.db
kobaltBuild
Thumbs.db
.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
local.properties

24
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,24 @@
image: fedora:latest
variables:
CI_NAME: "GitLab CI"
stages:
- test
before_script:
- dnf -qy update && dnf -y install zip
- curl -s "https://get.sdkman.io" | bash
- echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config
- echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config
- source "$HOME/.sdkman/bin/sdkman-init.sh"
- sdk install java
- sdk install kotlin
- source "$HOME/.sdkman/bin/sdkman-init.sh"
test:
stage: test
script:
- ./bld download
- ./bld compile
- ./bld test

30
.idea/app.iml generated Normal file
View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/build/main" />
<output-test url="file://$MODULE_DIR$/build/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" relativeOutputPath="resources" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/kotlin" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/kotlin" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" scope="RUNTIME">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$/src/main/resources/templates" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="compile" level="project" />
<orderEntry type="library" scope="RUNTIME" name="runtime" level="project" />
<orderEntry type="library" scope="TEST" name="test" level="project" />
</component>
</module>

14
.idea/bld.iml generated Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/build/bld" />
<output-test url="file://$MODULE_DIR$/build/bld" />
<exclude-output />
<content url="file://$MODULE_DIR$/src/bld">
<sourceFolder url="file://$MODULE_DIR$/src/bld/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="bld" level="project" />
</component>
</module>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
<component name="BldConfiguration">
<events />
</component>
</project>

View file

@ -1,6 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="&amp;#36;file.fileName&#10;&#10;Copyright (c) &amp;#36;today.year, Erik C. Thauvin (erik@thauvin.net)&#10;All rights reserved.&#10;&#10;Redistribution and use in source and binary forms, with or without&#10;modification, are permitted provided that the following conditions are met:&#10;&#10; Redistributions of source code must retain the above copyright notice, this&#10; list of conditions and the following disclaimer.&#10;&#10; Redistributions in binary form must reproduce the above copyright notice,&#10; this list of conditions and the following disclaimer in the documentation&#10; and/or other materials provided with the distribution.&#10;&#10; Neither the name of this project nor the names of its contributors may be&#10; used to endorse or promote products derived from this software without&#10; specific prior written permission.&#10;&#10;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;&#10;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&#10;IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&#10;DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE&#10;FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&#10;DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR&#10;SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER&#10;CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,&#10;OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE&#10;OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." />
<option name="notice" value="&amp;#36;file.fileName&#10;&#10;Copyright (c) 2017-&amp;#36;today.year, Erik C. Thauvin (erik@thauvin.net)&#10;&#10;Redistribution and use in source and binary forms, with or without&#10;modification, are permitted provided that the following conditions are met:&#10;&#10; Redistributions of source code must retain the above copyright notice, this&#10; list of conditions and the following disclaimer.&#10;&#10; Redistributions in binary form must reproduce the above copyright notice,&#10; this list of conditions and the following disclaimer in the documentation&#10; and/or other materials provided with the distribution.&#10;&#10; Neither the name of this project nor the names of its contributors may be&#10; used to endorse or promote products derived from this software without&#10; specific prior written permission.&#10;&#10;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;&#10;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE&#10;IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&#10;DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE&#10;FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&#10;DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR&#10;SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER&#10;CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,&#10;OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE&#10;OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." />
<option name="myName" value="Erik's Copyright Notice" />
</copyright>
</component>

View file

@ -1,15 +1,3 @@
<component name="CopyrightManager">
<settings>
<module2copyright>
<element module="Source" copyright="Erik's Copyright Notice" />
</module2copyright>
<LanguageOptions name="JAVA">
<option name="fileTypeOverride" value="3" />
<option name="addBlankAfter" value="false" />
</LanguageOptions>
<LanguageOptions name="Kotlin">
<option name="fileTypeOverride" value="3" />
<option name="addBlankAfter" value="false" />
</LanguageOptions>
</settings>
<settings default="Erik's Copyright Notice" />
</component>

6
.idea/icon.svg generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="290px" height="290px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
<g><path style="opacity:1" fill="#172ff1" d="M -0.5,-0.5 C 96.1667,-0.5 192.833,-0.5 289.5,-0.5C 289.5,96.1667 289.5,192.833 289.5,289.5C 192.833,289.5 96.1667,289.5 -0.5,289.5C -0.5,192.833 -0.5,96.1667 -0.5,-0.5 Z"/></g>
<g><path style="opacity:1" fill="#fcfdfe" d="M 105.5,36.5 C 107.309,44.7755 108.142,53.4421 108,62.5C 130.167,82 152.333,101.5 174.5,121C 182.659,120.794 190.825,120.294 199,119.5C 201.833,119.833 204.667,120.167 207.5,120.5C 196.031,132.008 184.698,143.508 173.5,155C 197.398,185.275 221.898,215.109 247,244.5C 248.919,246.691 250.253,249.024 251,251.5C 219.592,225.547 188.092,199.714 156.5,174C 155.5,173.333 154.5,173.333 153.5,174C 142.586,185.15 131.586,196.316 120.5,207.5C 120.167,204.667 119.833,201.833 119.5,199C 120.294,190.825 120.794,182.659 121,174.5C 101.618,152.623 82.4511,130.623 63.5,108.5C 54.5,107.833 45.5,107.167 36.5,106.5C 59.5211,83.1458 82.5211,59.8125 105.5,36.5 Z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1,53 +1,9 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="FieldMayBeFinal" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="created" />
</inspection_tool>
<inspection_tool class="LocalCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true">
<option name="REPORT_VARIABLES" value="true" />
<option name="REPORT_PARAMETERS" value="false" />
<option name="REPORT_CATCH_PARAMETERS" value="false" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="UnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="WeakerAccess" enabled="true" level="WARNING" enabled_by_default="true">
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="false" />
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ADDITIONAL_TAGS" value="created" />
</inspection_tool>
<inspection_tool class="UsePropertyAccessSyntax" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
</profile>
</component>

19
.idea/kobalt.xml generated
View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KobaltSettings">
<option name="linkedExternalProjectsSettings">
<KobaltProjectSettings>
<option name="autoDownloadKobalt" value="true" />
<option name="downloadSources" value="false" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="kobaltHome" value="$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.86" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="profiles" value="" />
</KobaltProjectSettings>
</option>
</component>
</project>

18
.idea/libraries/bld.xml generated Normal file
View file

@ -0,0 +1,18 @@
<component name="libraryTable">
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
</excluded>
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" />
</library>
</component>

13
.idea/libraries/compile.xml generated Normal file
View file

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="compile">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/compile" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/compile" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
</library>
</component>

14
.idea/libraries/runtime.xml generated Normal file
View file

@ -0,0 +1,14 @@
<component name="libraryTable">
<library name="runtime">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/runtime" />
<root url="file://$PROJECT_DIR$/src/main/resources" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/runtime" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
</library>
</component>

14
.idea/libraries/test.xml generated Normal file
View file

@ -0,0 +1,14 @@
<component name="libraryTable">
<library name="test">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/test" />
<root url="file://$PROJECT_DIR$/src/test/resources" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/test" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
</library>
</component>

25
.idea/misc.xml generated
View file

@ -1,4 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8.x" project-jdk-type="JavaSDK" />
<component name="EntryPointsManager">
<pattern value="net.thauvin.erik.PinboardPosterBuild" method="jacoco" />
<pattern value="net.thauvin.erik.pinboard.PinboardPosterBuild" method="jacoco" />
<pattern value="net.thauvin.erik.pinboard.PinboardPosterBuild" method="detekt" />
<pattern value="net.thauvin.erik.pinboard.PinboardPosterBuild" method="detektBaseline" />
<pattern value="net.thauvin.erik.pinboard.PinboardPosterBuild" />
</component>
<component name="PDMPlugin">
<option name="customRuleSets">
<list>
<option value="K:\java\semver\config\pmd.xml" />
<option value="$PROJECT_DIR$/../../java/bld-pitest/config/pmd.xml" />
<option value="$PROJECT_DIR$/../../java/bld-jacoco-report/config/pmd.xml" />
<option value="$PROJECT_DIR$/../../java/bld-checkstyle/config/pmd.xml" />
<option value="$PROJECT_DIR$/../../java/bld-exec/config/pmd.xml" />
<option value="$PROJECT_DIR$/../../java/bld-testng/config/pmd.xml" />
<option value="$PROJECT_DIR$/../../java/bld-generated-version/config/pmd.xml" />
</list>
</option>
<option name="skipTestSources" value="false" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build" />
</component>
</project>

4
.idea/modules.xml generated
View file

@ -2,8 +2,8 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/kobalt/Build.kt.iml" filepath="$PROJECT_DIR$/kobalt/Build.kt.iml" />
<module fileurl="file://$PROJECT_DIR$/pinboard-poster.iml" filepath="$PROJECT_DIR$/pinboard-poster.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/app.iml" filepath="$PROJECT_DIR$/.idea/app.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/bld.iml" filepath="$PROJECT_DIR$/.idea/bld.iml" />
</modules>
</component>
</project>

9
.idea/runConfigurations/Run Tests.xml generated Normal file
View file

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Tests" type="Application" factoryName="Application" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="net.thauvin.erik.PinboardPosterTest" />
<module name="app" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

View file

@ -1,3 +0,0 @@
<component name="DependencyValidationManager">
<scope name="Source" pattern="file[pinboard-poster]:src/main/java//*.java||file[pinboard-poster]:src/main/kotlin//*.kt" />
</component>

124
.idea/uiDesigner.xml generated
View file

@ -1,124 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

2
.idea/vcs.xml generated
View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -1,19 +0,0 @@
language: java
jdk:
- oraclejdk8
before_install:
- chmod +x kobaltw
install: true
cache:
directories:
- $HOME/.m2
- $HOME/.kobalt
before_cache:
- rm -rf .kobalt/*
script: ./kobaltw clean assemble

11
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Run Tests",
"request": "launch",
"mainClass": "net.thauvin.erik.pinboard.PinboardPosterTest"
}
]
}

15
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,15 @@
{
"java.project.sourcePaths": [
"src/main/java",
"src/main/resources",
"src/test/java",
"src/test/resources",
"src/bld/java",
"src/bld/resources"
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-2.2.1.jar",
"lib/**/*.jar"
]
}

61
CHANGELOG.md Normal file
View file

@ -0,0 +1,61 @@
# Changelog
## [1.1.0](https://github.com/ethauvin/pinboard-poster/tree/1.1.0) (2023-09-28)
[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/1.0.3...1.1.0)
**Implemented enhancements:**
- Add pin config builder [\#10](https://github.com/ethauvin/pinboard-poster/issues/10)
**Fixed bugs:**
- Fixed potential resource leak [\#11](https://github.com/ethauvin/pinboard-poster/issues/11)
## [1.0.3](https://github.com/ethauvin/pinboard-poster/tree/1.0.3) (2021-03-22)
[Full Changelog](https://github.com/ethauvin/pinboard-poster/compare/1.0.2...1.0.3)
**Fixed bugs:**
- 1.0.2 only compiled for Java 15 [\#4](https://github.com/ethauvin/pinboard-poster/issues/4)
## [1.0.2](https://github.com/ethauvin/pinboard-poster/tree/1.0.2) (2021-03-22)
[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:**
- 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 Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

27
LICENSE.txt Normal file
View file

@ -0,0 +1,27 @@
Copyright (c) 2017-2025, Erik C. Thauvin (erik@thauvin.net)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* 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.
* Neither the name of this project nor the names of its 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
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.

164
README.md
View file

@ -1,8 +1,18 @@
# [Pinboard](https://pinboard.in) Poster for Kotlin/Java
# [Pinboard](https://pinboard.in) Poster for Kotlin, Java and Android
[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![Build Status](https://travis-ci.org/ethauvin/pinboard-poster.svg?branch=master)](https://travis-ci.org/ethauvin/pinboard-poster) [![Dependency Status](https://www.versioneye.com/user/projects/591c0293b81f680038a784b3/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/591c0293b81f680038a784b3) [![Download](https://api.bintray.com/packages/ethauvin/maven/pinboard-poster/images/download.svg) ](https://bintray.com/ethauvin/maven/pinboard-poster/_latestVersion)
[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause)
[![Kotlin](https://img.shields.io/badge/kotlin-2.1.20-7f52ff)](https://kotlinlang.org/)
[![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![Release](https://img.shields.io/github/release/ethauvin/pinboard-poster.svg)](https://github.com/ethauvin/pinboard-poster/releases/latest)
[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/pinboard-poster.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/pinboard-poster)
[![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/pinboard-poster?label=snapshot&server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/pinboard-poster/)
A small Kotlin/Java library for posting to [Pinboard](https://pinboard.in).
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_pinboard-poster&metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_pinboard-poster)
[![GitHub CI](https://github.com/ethauvin/pinboard-poster/actions/workflows/bld.yml/badge.svg)](https://github.com/ethauvin/pinboard-poster/actions/workflows/bld.yml)
[![CircleCI](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master)
A small library for posting to [Pinboard](https://pinboard.in).
## Examples
@ -12,71 +22,80 @@ A small Kotlin/Java library for posting to [Pinboard](https://pinboard.in).
val poster = PinboardPoster("user:TOKEN")
poster.addPin("http://www.example.com/foo", "This is a test")
poster.deletePin("http:///www.example.com/bar")
poster.addPin("https://example.com/foo", "This is a test")
poster.addPin("https://example.com", "This is a test", tags = arrayOf("foo", "bar"))
poster.deletePin("https://example.com/bar")
```
[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/src/main/kotlin/net/thauvin/erik/pinboard/PinboardPoster.kt#L199)
[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples)
### Java
```java
final PinboardPoster poster = new PinBboardPoster("user:TOKEN");
poster.addPin("http://www.example.com/foo", "This is a test");
poster.deletePin("http:///www.example.com/bar");
poster.addPin("https://example.com/foo", "This is a test");
poster.addPin(new PinConfig.Builder("https://example.com", "This is a test")
.tags("foo", "bar")
.build());
poster.deletePin("https://example.com/bar");
```
[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/src/main/java/net/thauvin/erik/pinboard/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 Maven, Gradle and Kobalt
## bld
### Maven
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:
To install and run from Maven, configure an artifact as follows:
```java
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);
```xml
<dependency>
<groupId>net.thauvin.erik</groupId>
<artifactId>pinboard-poster</artifactId>
<version>0.9.1</version>
</dependency>
scope(compile)
.include(dependency("net.thauvin.erik:pinboard-poster:1.2.0"));
```
Be sure to use the [bld Kotlin extension](https://github.com/rife2/bld-kotlin) in your project.
### Gradle
[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/examples/bld/)
To install and run from Gradle, add the following to the build.gradle file:
## Gradle, Maven, etc.
To install and run from Gradle, add the following to the `build.gradle` file:
```gradle
repositories {
mavenCentral()
}
dependencies {
compileOnly 'net.thauvin.erik:pinboard-poster:0.9.1'
compile 'net.thauvin.erik:pinboard-poster:1.2.0'
}
```
### Kobalt
[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples/gradle/)
To install and run from Kobalt, add the following to the Build.kt file:
```gradle
dependencies {
compile("net.thauvin.erik:pinboard-poster:0.9.1")
}
```
Instructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://central.sonatype.com/artifact/net.thauvin.erik/pinboard-poster).
## Adding
The `addPin` function support all of the [Pinboard API parameters](https://pinboard.in/api/#posts_add):
```kotlin
poster.addPin(url = "http://www.example.com",
description = "This is the title.",
import java.time.ZonedDateTime
poster.addPin(
url = "https://www.example.com",
description = "This is the title",
extended = "This is the extended description.",
tags = "tag1 tag2 tag3",
dt = "2010-12-11T19:48:02Z",
tags = arrayOf("tag1", "tag2", "tag3"),
dt = ZonedDateTime.now(),
replace = true,
shared = true,
toRead = false)
toRead = false
)
```
`url` and `description` are required.
@ -88,7 +107,7 @@ It returns `true` if the bookmark was added successfully, `false` otherwise.
The `deletePin` function support all of the [Pinboard API parameters](https://pinboard.in/api/#posts_delete):
```kotlin
poster.deletePin(url = "http://www.example.com/")
poster.deletePin(url = "https://www.example.com/")
```
It returns `true` if the bookmark was deleted successfully, `false` otherwise.
@ -98,23 +117,78 @@ It returns `true` if the bookmark was deleted successfully, `false` otherwise.
The library used [`java.util.logging`](https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html) to log errors. Logging can be configured as follows:
#### Kotlin
```kotlin
with(poster.logger) {
addHandler(ConsoleHandler().apply { level = Level.FINE })
level = Level.FINE
useParentHandlers = false
}
```
#### Java
```java
final ConsoleHandler consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(Level.FINE);
final Logger logger = poster.getLogger();
logger.addHandler(consoleHandler);
logger.setLevel(Level.FINE);
logger.setUseParentHandlers(false);
```
or using a logging properties file.
or using a property file.
## API Authentication Token
The token can also be located in a [properties file](https://en.wikipedia.org/wiki/.properties) or environment variable.
### Local Property
For example, using the default `PINBOARD_API_TOKEN` key value from a `local.properties` file:
```ini
# local.properties
PINBOARD_API_TOKEN=user\:TOKEN
```
```kotlin
val poster = PinboardPoster(Paths.get("local.properties"))
```
or by specifying your own key:
```ini
# my.properties
my.api.key=user\:TOKEN
```
```kotlin
val poster = PinboardPoster(Paths.get("my.properties"), "my.api.key")
```
or even specifying your own property:
```kotlin
val p = Properties()
p.setProperty("api.key", "user:TOKEN")
val poster = PinboardPoster(p, "api.key")
```
_In all cases, the value of the `PINBOARD_API_TOKEN` environment variable is used by default if the specified property is invalid or not found._
### Environment Variable
If no arguments are passed to the constructor, the value of the `PINBOARD_API_TOKEN` environment variable will be used, if any.
```sh
export PINBOARD_API_TOKEN="user:TOKEN"
```
```kotlin
val poster = PinboardPoster()
```
## API End Point
@ -123,3 +197,21 @@ The API end point is automatically configured to `https://api.pinboard.in/v1/`.
```kotlin
poster.apiEndPoint = "https://www.example.com/v1"
```
## Contributing
If you want to contribute to this project, all you have to do is clone the GitHub
repository:
```console
git clone git@github.com:ethauvin/pinboard-poster.git
```
Then use [bld](https://rife2.com/bld) to build:
```console
cd pinboard-poster
./bld compile
```
The project has an [IntelliJ IDEA](https://www.jetbrains.com/idea/) project structure. You can just open it after all the dependencies were downloaded and peruse the code.

20
bitbucket-pipelines.yml Normal file
View file

@ -0,0 +1,20 @@
image: ubuntu:latest
pipelines:
default:
- step:
name: Test with bld
script:
# Install latest Java & Kotlin via SDKMAN!
- apt-get update -qq && apt-get install -y curl zip
- curl -s "https://get.sdkman.io" | bash
- echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config
- echo sdkman_auto_selfupdate=true >> $HOME/.sdkman/etc/config
- source "$HOME/.sdkman/bin/sdkman-init.sh"
- sdk install java
- sdk install kotlin
- source "$HOME/.sdkman/bin/sdkman-init.sh"
# Download, compile and test with bld
- ./bld download
- ./bld compile
- ./bld test

2
bld Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env sh
java -jar "$(dirname "$0")/lib/bld/bld-wrapper.jar" "$0" --build net.thauvin.erik.pinboard.PinboardPosterBuild "$@"

4
bld.bat Normal file
View file

@ -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 %*

View file

@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
<ID>LongParameterList:PinConfig.kt$PinConfig$( var url: String, var description: String, var extended: String = "", var tags: Array&lt;out String&gt; = emptyArray(), var dt: ZonedDateTime = ZonedDateTime.now(), var replace: Boolean = true, var shared: Boolean = true, var toRead: Boolean = false )</ID>
<ID>LongParameterList:PinboardPoster.kt$PinboardPoster$( url: String, description: String, extended: String = "", vararg tags: String = emptyArray(), dt: ZonedDateTime = ZonedDateTime.now(), replace: Boolean = true, shared: Boolean = true, toRead: Boolean = false )</ID>
<ID>NestedBlockDepth:PinboardPoster.kt$PinboardPoster$private fun executeMethod(method: String, params: Map&lt;String, String&gt;): Boolean</ID>
<ID>ThrowsCount:PinboardPoster.kt$PinboardPoster$@Throws(IOException::class) internal fun parseMethodResponse(method: String, response: String)</ID>
<ID>TooManyFunctions:PinConfig.kt$PinConfig$Builder</ID>
</CurrentIssues>
</SmellBaseline>

55
examples/bld/.gitignore vendored Normal file
View file

@ -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

3
examples/bld/.idea/.gitignore generated vendored Normal file
View file

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

1
examples/bld/.idea/.name generated Normal file
View file

@ -0,0 +1 @@
pinboard-poster-examples-bld

30
examples/bld/.idea/app.iml generated Normal file
View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/build/main" />
<output-test url="file://$MODULE_DIR$/build/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" relativeOutputPath="resources" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/kotlin" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/kotlin" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" scope="RUNTIME">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$/src/main/resources/templates" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="compile" level="project" />
<orderEntry type="library" scope="RUNTIME" name="runtime" level="project" />
<orderEntry type="library" scope="TEST" name="test" level="project" />
</component>
</module>

14
examples/bld/.idea/bld.iml generated Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/build/bld" />
<output-test url="file://$MODULE_DIR$/build/bld" />
<exclude-output />
<content url="file://$MODULE_DIR$/src/bld">
<sourceFolder url="file://$MODULE_DIR$/src/bld/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="bld" level="project" />
</component>
</module>

6
examples/bld/.idea/bld.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BldConfiguration">
<events />
</component>
</project>

View file

@ -0,0 +1,8 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ADDITIONAL_TAGS" value="created" />
</inspection_tool>
</profile>
</component>

18
examples/bld/.idea/libraries/bld.xml generated Normal file
View file

@ -0,0 +1,18 @@
<component name="libraryTable">
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
</excluded>
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" />
</library>
</component>

13
examples/bld/.idea/libraries/compile.xml generated Normal file
View file

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="compile">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/compile" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/compile" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
</library>
</component>

14
examples/bld/.idea/libraries/runtime.xml generated Normal file
View file

@ -0,0 +1,14 @@
<component name="libraryTable">
<library name="runtime">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/runtime" />
<root url="file://$PROJECT_DIR$/src/main/resources" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/runtime" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
</library>
</component>

14
examples/bld/.idea/libraries/test.xml generated Normal file
View file

@ -0,0 +1,14 @@
<component name="libraryTable">
<library name="test">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/test" />
<root url="file://$PROJECT_DIR$/src/test/resources" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/test" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
</library>
</component>

9
examples/bld/.idea/misc.xml generated Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PDMPlugin">
<option name="skipTestSources" value="false" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build" />
</component>
</project>

9
examples/bld/.idea/modules.xml generated Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/app.iml" filepath="$PROJECT_DIR$/.idea/app.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/bld.iml" filepath="$PROJECT_DIR$/.idea/bld.iml" />
</modules>
</component>
</project>

View file

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Tests" type="Application" factoryName="Application" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="net.thauvin.erik.samples.JavaExampleTest" />
<module name="app" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

6
examples/bld/.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

11
examples/bld/.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Run Tests",
"request": "launch",
"mainClass": "net.thauvin.erik.pinboard.samples.JavaExampleTest"
}
]
}

15
examples/bld/.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,15 @@
{
"java.project.sourcePaths": [
"src/main/java",
"src/main/resources",
"src/test/java",
"src/test/resources",
"src/bld/java",
"src/bld/resources"
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-2.2.1.jar",
"lib/**/*.jar"
]
}

18
examples/bld/README.md Normal file
View file

@ -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
```

2
examples/bld/bld Executable file
View file

@ -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 "$@"

4
examples/bld/bld.bat Normal file
View file

@ -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 %*

Binary file not shown.

View file

@ -0,0 +1,7 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=2.2.1

View file

@ -0,0 +1,54 @@
package net.thauvin.erik.pinboard.samples;
import rife.bld.BaseProject;
import rife.bld.BuildCommand;
import rife.bld.extension.CompileKotlinOperation;
import rife.bld.extension.kotlin.CompileOptions;
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, 2, 1, "SNAPSHOT")));
}
public static void main(String[] args) {
new ExampleBuild().start(args);
}
@Override
public void compile() throws Exception {
new CompileKotlinOperation()
.fromProject(this)
.compileOptions(new CompileOptions().verbose(true))
.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();
}
}

View file

@ -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);
if (poster.validate()) {
// Add Pin
if (poster.addPin(new PinConfig.Builder(url, "Testing")
.extended("Extra")
.tags("test", "java")
.build())) {
System.out.println("Added: " + url);
}
// Delete Pin
if (poster.deletePin(url)) {
System.out.println("Deleted: " + url);
}
}
}
}

View file

@ -0,0 +1,37 @@
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<String>) {
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
useParentHandlers = false
}
if (poster.validate()) {
// 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")
}
}
}

View file

@ -0,0 +1,2 @@
[*]
insert_final_newline=true

29
examples/gradle/java/.gitignore vendored Normal file
View file

@ -0,0 +1,29 @@
**/.idea/dictionaries
**/.idea/gradle.xml
**/.idea/libraries
**/.idea/tasks.xml
**/.idea/workspace.xml
*.sublime-*
*.iws
.classpath
.DS_Store
.gradle
.kobalt
.nb-gradle
.project
.settings
/bin
/build
/deploy
/dist
/gen
/gradle.properties
/local.properties
/out
/proguard-project.txt
/project.properties
/target
/test-output
ehthumbs.db
kobaltBuild
Thumbs.db

3
examples/gradle/java/.idea/.gitignore generated vendored Normal file
View file

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

1
examples/gradle/java/.idea/.name generated Normal file
View file

@ -0,0 +1 @@
pinboard-poster-examples-gradle-java

6
examples/gradle/java/.idea/compiler.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
</component>
</project>

View file

@ -0,0 +1,8 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ADDITIONAL_TAGS" value="created" />
</inspection_tool>
</profile>
</component>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenLocal" />
<option name="name" value="MavenLocal" />
<option name="url" value="file:$MAVEN_REPOSITORY$/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
</component>
</project>

8
examples/gradle/java/.idea/misc.xml generated Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="17" project-jdk-type="JavaSDK" />
</project>

6
examples/gradle/java/.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

View file

@ -0,0 +1,5 @@
## Run the Example
```console
./gradlew run
```

View file

@ -0,0 +1,26 @@
plugins {
id 'com.github.ben-manes.versions' version '0.51.0'
id 'java'
id 'application'
}
defaultTasks 'run'
application {
mainClass = 'net.thauvin.erik.pinboard.samples.JavaExample'
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenLocal()
mavenCentral()
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
}
dependencies {
implementation 'net.thauvin.erik:pinboard-poster:1.2.1-SNAPSHOT'
}

Binary file not shown.

View file

@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

251
examples/gradle/java/gradlew vendored Executable file
View file

@ -0,0 +1,251 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

94
examples/gradle/java/gradlew.bat vendored Normal file
View file

@ -0,0 +1,94 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View file

@ -0,0 +1,10 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user guide at https://docs.gradle.org/4.8/userguide/multi_project_builds.html
*/
rootProject.name = 'pinboard-poster-examples-gradle-java'

View file

@ -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);
if (poster.validate()) {
// Add Pin
if (poster.addPin(new PinConfig.Builder(url, "Testing")
.extended("Extra")
.tags("test", "java")
.build())) {
System.out.println("Added: " + url);
}
// Delete Pin
if (poster.deletePin(url)) {
System.out.println("Deleted: " + url);
}
}
}
}

View file

@ -0,0 +1,2 @@
[*]
insert_final_newline=true

29
examples/gradle/kotlin/.gitignore vendored Normal file
View file

@ -0,0 +1,29 @@
**/.idea/dictionaries
**/.idea/gradle.xml
**/.idea/libraries
**/.idea/tasks.xml
**/.idea/workspace.xml
*.sublime-*
*.iws
.classpath
.DS_Store
.gradle
.kobalt
.nb-gradle
.project
.settings
/bin
/build
/deploy
/dist
/gen
/gradle.properties
/local.properties
/out
/proguard-project.txt
/project.properties
/target
/test-output
ehthumbs.db
kobaltBuild
Thumbs.db

3
examples/gradle/kotlin/.idea/.gitignore generated vendored Normal file
View file

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

1
examples/gradle/kotlin/.idea/.name generated Normal file
View file

@ -0,0 +1 @@
pinboard-post-examples-gradle-kotlin

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
</component>
</project>

View file

@ -0,0 +1,8 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ADDITIONAL_TAGS" value="created" />
</inspection_tool>
</profile>
</component>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenLocal" />
<option name="name" value="MavenLocal" />
<option name="url" value="file:$MAVEN_REPOSITORY$/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
</component>
</project>

9
examples/gradle/kotlin/.idea/kotlin.iml generated Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="2.0.0" />
</component>
</project>

8
examples/gradle/kotlin/.idea/misc.xml generated Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="PDMPlugin">
<option name="skipTestSources" value="false" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="17" project-jdk-type="JavaSDK" />
</project>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/kotlin.iml" filepath="$PROJECT_DIR$/.idea/kotlin.iml" />
</modules>
</component>
</project>

6
examples/gradle/kotlin/.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

View file

@ -0,0 +1,5 @@
## Run the Example
```console
./gradlew run
```

View file

@ -0,0 +1,32 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("application")
id("com.github.ben-manes.versions") version "0.51.0"
kotlin("jvm") version "2.1.20"
}
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
repositories {
mavenLocal()
mavenCentral()
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
}
dependencies {
implementation("net.thauvin.erik:pinboard-poster:1.2.1-SNAPSHOT")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
application {
mainClass.set("net.thauvin.erik.pinboard.samples.KotlinExampleKt")
}
kotlin {
compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}

Binary file not shown.

View file

@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

251
examples/gradle/kotlin/gradlew vendored Executable file
View file

@ -0,0 +1,251 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

94
examples/gradle/kotlin/gradlew.bat vendored Normal file
View file

@ -0,0 +1,94 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View file

@ -0,0 +1 @@
rootProject.name = "pinboard-post-examples-gradle-kotlin"

View file

@ -0,0 +1,37 @@
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<String>) {
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
useParentHandlers = false
}
if (poster.validate()) {
// 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")
}
}
}

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Build.kt" external.linked.project.path="$MODULE_DIR$/.." external.root.project.path="$MODULE_DIR$/.." external.system.id="KOBALT" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/out/classes" />
<output-test url="file://$MODULE_DIR$/out/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="Kobalt: com.beust.kobalt:kobalt:jar:1.0.86">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.86/kobalt/wrapper/kobalt-1.0.86.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.kobalt/wrapper/dist/kobalt-1.0.86/kobalt/wrapper/kobalt-1.0.86-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Kobalt: kobalt-versioneye-0.4.5.jar">
<CLASSES>
<root url="jar://$USER_HOME$/.kobalt/cache/net/thauvin/erik/kobalt-versioneye/0.4.5/kobalt-versioneye-0.4.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

View file

@ -1,107 +0,0 @@
import com.beust.kobalt.buildScript
import com.beust.kobalt.glob
import com.beust.kobalt.plugin.application.application
import com.beust.kobalt.plugin.packaging.assemble
import com.beust.kobalt.plugin.packaging.install
import com.beust.kobalt.plugin.publish.autoGitTag
import com.beust.kobalt.plugin.publish.bintray
import com.beust.kobalt.project
import net.thauvin.erik.kobalt.plugin.versioneye.versionEye
import org.apache.maven.model.Developer
import org.apache.maven.model.License
import org.apache.maven.model.Model
import org.apache.maven.model.Scm
import java.io.File
import java.io.FileInputStream
import java.util.*
val bs = buildScript {
plugins("net.thauvin.erik:kobalt-versioneye:", "net.thauvin.erik:kobalt-maven-local:")
}
val p = project {
name = "pinboard-poster"
group = "net.thauvin.erik"
description = "Pinboard Poster for Kotlin/Java"
artifactId = name
version = "0.9.1"
val localProperties = Properties().apply {
val f = "local.properties"
if (File(f).exists()) FileInputStream(f).use { fis -> load(fis) }
}
val apiToken = localProperties.getProperty("pinboard-api-token", "")
pom = Model().apply {
description = project.description
url = "https://github.com/ethauvin/pinboard-poster"
licenses = listOf(License().apply {
name = "BSD 3-Clause"
url = "https://opensource.org/licenses/BSD-3-Clause"
})
scm = Scm().apply {
url = "https://github.com/ethauvin/pinboard-poster"
connection = "https://github.com/ethauvin/pinboard-poster.git"
developerConnection = "git@github.com:ethauvin/pinboard-poster.git"
}
developers = listOf(Developer().apply {
id = "ethauvin"
name = "Erik C. Thauvin"
email = "erik@thauvin.net"
})
}
dependencies {
compile("org.jetbrains.kotlin:kotlin-stdlib:1.1.2-3")
compile("com.squareup.okhttp3:okhttp:3.8.0")
}
dependenciesTest {
//compile("org.testng:testng:6.11")
//compile("org.jetbrains.kotlin:kotlin-test:1.1.2-3")
}
assemble {
jar { }
mavenJars { }
}
application {
mainClass = "net.thauvin.erik.pinboard.PinboardPosterKt"
args(apiToken)
}
application {
taskName = "runJava"
mainClass = "net.thauvin.erik.pinboard.JavaExample"
args(apiToken)
}
install {
target = "deploy"
include(from("kobaltBuild/libs"), to(target), glob("**/*"))
collect(compileDependencies).forEach {
copy(from(it.file.absolutePath), to(target))
}
}
autoGitTag {
enabled = true
//push = false
message = "Version $version"
}
bintray {
publish = true
description = "Release version $version"
issueTrackerUrl = "https://github.com/ethauvin/pinboard-poster/issues"
vcsTag = version
sign = true
}
versionEye {
org = "Thauvin"
team = "Owners"
pom = true
}
}

Binary file not shown.

View file

@ -1 +0,0 @@
kobalt.version=1.0.86

Some files were not shown because too many files have changed in this diff Show more