Compare commits

...

154 commits

Author SHA1 Message Date
Excavator Bot
92909eca41
Excavator: Upgrade gradle wrapper to the latest version (#549) 2023-02-26 16:26:36 +00:00
Excavator Bot
d2ab1a8399
Excavator: Update gradle-jdks infrastructure plugins (#548) 2023-02-20 14:10:29 +00:00
Excavator Bot
004edc9419
Excavator: Update gradle-jdks infrastructure plugins (#547) 2023-02-15 13:54:25 +00:00
Excavator Bot
ee5ed04e2d
Excavator: Upgrade buildscript dependencies (#546) 2023-02-14 06:00:56 +00:00
Excavator Bot
1a17ee9a4d
Excavator: Update gradle-jdks infrastructure plugins (#545) 2023-02-13 21:53:45 +00:00
Excavator Bot
1eef78c506
Excavator: Enforce that Jakarta dependency versions use the new 'jakarta' namespace, or replace it with an equivalent Java EE dependency instead (#544) 2023-02-09 23:24:33 +00:00
Excavator Bot
d469fca424
Excavator: Enforce that Jakarta dependency versions use the new 'jakarta' namespace, or replace it with an equivalent Java EE dependency instead (#543) 2023-02-08 22:16:03 +00:00
Excavator Bot
1342ce6795
Excavator: Render CircleCI file using template specified in .circleci/template.sh (#542) 2023-02-08 16:17:33 +00:00
Excavator Bot
f42ab782fb
Excavator: Enforce that Jakarta dependency versions use the new 'jakarta' namespace, or replace it with an equivalent Java EE dependency instead (#541) 2023-02-08 01:52:41 +00:00
Excavator Bot
075239cf4c
Excavator: Render CircleCI file using template specified in .circleci/template.sh (#540) 2023-02-04 11:35:35 +00:00
Excavator Bot
1e59f588f3
Excavator: Upgrades Baseline to the latest version (#539) 2023-02-01 19:21:58 +00:00
Excavator Bot
15c7cbe2ae
Excavator: Upgrades Baseline to the latest version (#538) 2023-01-30 22:15:17 +00:00
Excavator Bot
67ddee43c0
Excavator: Update gradle-jdks infrastructure plugins (#537) 2023-01-19 23:53:59 +00:00
Excavator Bot
f5c8396da0
Excavator: Update gradle-jdks infrastructure plugins (#536) 2023-01-17 18:12:26 +00:00
Excavator Bot
ec21f6b8d9
Excavator: Upgrades Baseline to the latest version (#534) 2023-01-06 19:15:25 +00:00
Excavator Bot
c8e939f45b
Excavator: Update gradle-jdks infrastructure plugins (#533) 2022-12-15 11:36:50 +00:00
Excavator Bot
fcbe858fbd
Excavator: Upgrades Baseline to the latest version (#532) 2022-12-09 04:26:03 +00:00
Excavator Bot
a2d1ccc0ce
Excavator: Upgrade buildscript dependencies (#531) 2022-12-05 06:46:57 +00:00
Excavator Bot
1a64fb2eb3
Excavator: Upgrade gradle wrapper to the latest version (#530) 2022-12-01 07:22:10 +00:00
Excavator Bot
c31352f2ef
Excavator: Update open-source publishing plugins (#529) 2022-11-18 11:57:56 +00:00
Excavator Bot
7260681ddd
Excavator: Format Java files (#528) 2022-11-12 01:29:15 +00:00
Excavator Bot
7f9cc67604
Excavator: Upgrades Baseline to the latest version (#526) 2022-10-31 17:47:28 +00:00
Excavator Bot
17a695ad4b
Excavator: Render CircleCI file using template specified in .circleci/template.sh (#522) 2022-10-24 14:32:29 +00:00
Excavator Bot
9e96d519ab
Excavator: Upgrades Baseline to the latest version (#521) 2022-10-20 17:06:31 +00:00
Excavator Bot
537ea9a652
Excavator: Upgrades Baseline to the latest version (#520) 2022-10-15 01:08:20 +00:00
Excavator Bot
f83c47a82e
Excavator: Render CircleCI file using template specified in .circleci/template.sh (#517) 2022-10-04 17:13:01 +00:00
Excavator Bot
9f79dac3c2
Excavator: Format Java files (#519) 2022-10-04 08:53:25 +00:00
Excavator Bot
8d3324ecb8
Excavator: Upgrades Baseline to the latest version (#518) 2022-10-03 19:50:08 +00:00
Excavator Bot
f5666d769c
Excavator: Render CircleCI file using template specified in .circleci/template.sh (#516) 2022-09-30 06:50:28 +00:00
Excavator Bot
754cfad122
Excavator: Upgrades Baseline to the latest version (#515) 2022-09-30 04:11:26 +00:00
Excavator Bot
a72efce7f5
Excavator: Update policy-bot config (#514) 2022-09-28 23:01:03 +00:00
Excavator Bot
b74072c553
Excavator: Upgrades Baseline to the latest version (#513) 2022-09-27 12:09:43 +00:00
Excavator Bot
6a327c2ccb
Excavator: Upgrades Baseline to the latest version (#512) 2022-09-20 23:53:34 +00:00
Excavator Bot
734a33a5b5
Excavator: Upgrades Baseline to the latest version (#511) 2022-09-20 21:16:59 +00:00
Excavator Bot
58c34f9eba
Excavator: Upgrades Baseline to the latest version (#510) 2022-09-19 19:58:31 +00:00
Excavator Bot
6bf9899b87
Excavator: Upgrades Baseline to the latest version (#509) 2022-09-16 15:57:27 +00:00
Excavator Bot
0781d4b424
Excavator: Update policy-bot config (#508) 2022-09-16 05:25:44 +00:00
Excavator Bot
198006568d
Excavator: Upgrades Baseline to the latest version (#507) 2022-09-16 02:34:58 +00:00
Excavator Bot
baa37a506e
Excavator: Upgrades Baseline to the latest version (#506) 2022-09-15 19:04:07 +00:00
Excavator Bot
6a5ceddfc0
Excavator: Upgrades Baseline to the latest version (#505) 2022-09-12 15:59:33 +00:00
Excavator Bot
4e8aec841e
Excavator: Migrate annotation processors to native gradle implementation (#504) 2022-09-08 07:23:12 +00:00
Excavator Bot
ea3a10b2ab
Excavator: Update gradle-jdks infrastructure plugins (#503) 2022-09-03 00:36:23 +00:00
Excavator Bot
ab53555b56
Excavator: Upgrades Baseline to the latest version (#502) 2022-09-02 21:28:56 +00:00
Excavator Bot
27f73ff007
Excavator: Upgrades Baseline to the latest version (#499) 2022-08-08 13:35:43 +00:00
Excavator Bot
56d622f9d9
Excavator: Upgrades Baseline to the latest version (#495) 2022-08-06 11:48:10 +00:00
Excavator Bot
4d686311ef
Excavator: Update gradle-jdks infrastructure plugins (#498) 2022-08-06 09:58:28 +00:00
Excavator Bot
45e6fbbcca
Excavator: Upgrade gradle wrapper to the latest version (#497) 2022-08-05 23:13:21 +00:00
Excavator Bot
b3ba713de9
Excavator: Format Java files (#496) 2022-08-03 16:41:05 +00:00
Excavator Bot
fa031afa43
Excavator: Upgrades Baseline to the latest version (#494) 2022-07-30 00:06:04 +00:00
Excavator Bot
6b32e9dca7
Excavator: Upgrades Baseline to the latest version (#493) 2022-07-29 17:31:12 +00:00
Excavator Bot
30f6d5bd1b
Excavator: Upgrades Baseline to the latest version (#491) 2022-07-26 11:22:03 +00:00
Excavator Bot
df7393c4b5
Excavator: Upgrade gradle wrapper to the latest version (#490) 2022-07-14 13:09:44 +00:00
Excavator Bot
8b4bce9f93
Excavator: Format Java files (#489) 2022-07-14 01:54:32 +00:00
Excavator Bot
1e7b0b56fe
Excavator: Upgrades Baseline to the latest version (#488) 2022-07-05 23:51:23 +00:00
Excavator Bot
d640c77dde
Excavator: Update open-source publishing plugins (#487) 2022-06-29 09:58:16 +00:00
Excavator Bot
d83ec6ab8b
Excavator: Update gradle-jdks infrastructure plugins (#486) 2022-06-28 08:39:59 +00:00
svc-autorelease
f72b406a33
Autorelease 0.12.0 2022-06-23 12:15:29 +00:00
Robert Kruszewski
ac1019f247
Improvement: Publish to gradle plugin portal (#485)
Publish plugins to gradle plugin portal
2022-06-23 12:15:25 +00:00
Excavator Bot
3820e4c13d
Excavator: Apply gradle-jdks to OSS projects (#484) 2022-06-20 15:25:19 +00:00
Excavator Bot
eb0f10f79b
Excavator: Render CircleCI file using template specified in .circleci/template.sh (#483) 2022-06-20 15:22:02 +00:00
Excavator Bot
126cbea108
Excavator: Upgrade gradle wrapper to the latest version (#482) 2022-06-20 15:19:38 +00:00
Nicholas Gates
2ff61c134d
Upgrade the world (#481) 2022-06-20 09:48:27 +00:00
Excavator Bot
c51e6b1a47
Excavator: Automatically convert to Circle2 (#477)
* Excavator: Automatically convert to Circle2

* Java 11

Co-authored-by: Nicholas Gates <ngates@palantir.com>
2022-06-20 11:34:34 +02:00
Excavator Bot
d548fb71d7
Excavator: Upgrade dependencies (#480) 2022-06-14 21:37:19 +00:00
Excavator Bot
d2b0546dfb
Excavator: Upgrade dependencies (#479) 2022-06-01 18:56:35 +00:00
Excavator Bot
76e8394eda
Excavator: Consistent Gradle artifact repositories (#475) 2022-05-18 05:19:54 +00:00
Excavator Bot
b3c61b2ac7
Excavator: Upgrade dependencies (#474) 2022-05-02 22:38:24 +00:00
Excavator Bot
ca57783ec2
Excavator: Upgrade Jackson to the latest stable release (#473) 2022-04-15 07:01:50 +00:00
Excavator Bot
166b19e3a3
Excavator: Upgrade dependencies (#472) 2022-04-08 08:00:33 +00:00
Excavator Bot
dd886a6d8e
Excavator: Update policy-bot config (#471) 2022-04-01 22:48:37 +00:00
Excavator Bot
fec16abdb8
Excavator: Consistent Gradle artifact repositories (#470) 2022-04-01 18:27:59 +00:00
Excavator Bot
db34e6e535
Excavator: Update policy-bot config (#466) 2022-03-02 04:36:14 +00:00
Excavator Bot
d3127d801f
Excavator: Update policy-bot config (#465) 2022-03-01 15:26:12 +00:00
Excavator Bot
fc8ceba7f5
Excavator: Upgrade dependencies (#464) 2022-02-28 23:05:12 +00:00
Excavator Bot
456fce719e
Excavator: Update policy-bot config (#463) 2022-02-14 06:11:38 +00:00
Excavator Bot
55f742cf34
Excavator: Upgrade dependencies (#462) 2022-02-08 16:28:23 +00:00
Excavator Bot
dfabe5f7b9
Excavator: Auto-label some excavator PRs (#460) 2022-01-20 11:36:59 +00:00
Sebastian Schuberth
420cb8013e
README: Update the link to Graal options and make it clickable (#459) 2022-01-13 11:27:06 +00:00
Excavator Bot
b98577c20a
Excavator: Upgrade buildscript dependencies (#457) 2021-11-25 06:56:12 +00:00
Excavator Bot
0219641878
Excavator: Upgrade dependencies (#456) 2021-11-06 04:44:45 +00:00
Jorge
813f9a85da
Support Java 17 for GraalVM 21.3.0 (#455) 2021-10-25 18:58:20 +00:00
Excavator Bot
a8510843d7
Excavator: Upgrade dependencies (#453) 2021-09-28 08:24:58 +00:00
Excavator Bot
7d09b4d2ca
Excavator: Update open-source publishing plugins (#450) 2021-09-14 23:25:56 +00:00
Excavator Bot
371cf0c09c
Excavator: Migrate annotation processors to native gradle implementation (#449) 2021-08-28 05:37:43 +00:00
Excavator Bot
456f24c086
Excavator: Update open-source publishing plugins (#448) 2021-08-20 05:38:09 +00:00
Excavator Bot
cac5ecdf88
Excavator: Upgrade dependencies (#447) 2021-08-20 02:39:20 +00:00
Excavator Bot
0c954afddf
Excavator: Upgrade dependencies (#446) 2021-08-03 22:15:29 +00:00
Excavator Bot
4dc812e292
Excavator: Upgrade dependencies (#445) 2021-07-23 07:16:08 +00:00
Excavator Bot
4ef8c9dd2c
Excavator: Upgrade buildscript dependencies (#444) 2021-07-21 22:26:02 +00:00
Excavator Bot
66ca6bc759
Excavator: Consistent Gradle artifact repositories (#443) 2021-07-21 12:08:39 +00:00
Excavator Bot
97162da0f8
Excavator: Upgrade buildscript dependencies (#441) 2021-06-22 06:29:37 +00:00
Excavator Bot
2125a3b57b
Excavator: Update policy-bot config (#440) 2021-06-20 06:38:52 +00:00
Excavator Bot
1b16aae200
Excavator: Consistent Gradle artifact repositories (#437) 2021-06-15 05:02:41 +00:00
Excavator Bot
a565d6551a
Excavator: Update open-source publishing plugins (#436) 2021-06-10 07:03:43 +00:00
Excavator Bot
2abe9e5cbd
Excavator: Migrate publishing to gradle-external-publish-plugin (#434) 2021-06-10 05:59:52 +00:00
Carter Kozak
e480e2c7eb
Remove bintray references (#435) 2021-06-09 23:10:01 -04:00
svc-autorelease
54044a6f11
Autorelease 0.8.0 2021-06-08 21:02:41 +00:00
Jorge
0e0208da7e
Support Java 16 for Graal 21.1.0 (#432) 2021-06-08 21:02:38 +00:00
Excavator Bot
3aaf741129
Excavator: Upgrade dependencies (#433) 2021-06-08 19:13:55 +00:00
Excavator Bot
8728fd190c
Excavator: Update open-source publishing plugins (#431) 2021-05-31 12:03:08 +00:00
Excavator Bot
b5024925a0
Excavator: Upgrade dependencies (#428) 2021-05-14 23:33:59 +00:00
Excavator Bot
b76212d1e8
Excavator: Upgrade gradle wrapper to the latest version (#427) 2021-05-07 13:55:26 +00:00
Excavator Bot
2484b034ae
Excavator: Upgrade dependencies (#426) 2021-05-06 19:08:04 +00:00
Excavator Bot
36f105a220
Excavator: stale-bot closes PRs after 14 days of inactivity (#425) 2021-04-30 19:29:45 +00:00
Excavator Bot
1afb81590e
Excavator: stale-bot closes PRs after 14 days of inactivity (#424) 2021-04-30 06:23:52 +00:00
Excavator Bot
6d4aa25f26
Excavator: Consistent Gradle artifact repositories (#423) 2021-04-23 14:35:15 +00:00
Excavator Bot
f57505e1e3
Excavator: Update open-source publishing plugins (#419) 2021-04-08 06:48:36 +00:00
Excavator Bot
463119b1ac
Excavator: Upgrade dependencies (#414) 2021-04-08 01:48:04 +00:00
Excavator Bot
c676f8ac0c
Excavator: Consistent Gradle artifact repositories (#418) 2021-04-07 16:38:01 +00:00
Excavator Bot
2860547770
Excavator: Upgrade gradle wrapper to the latest version (#416) 2021-04-06 13:02:11 +00:00
Excavator Bot
68b8f18f84
Excavator: Update open-source publishing plugins (#407) 2021-02-20 08:17:08 +00:00
Excavator Bot
6c9f338e17
Excavator: Upgrade buildscript dependencies (#405) 2021-02-15 23:34:34 +00:00
Excavator Bot
9e4790db41
Excavator: Upgrade buildscript dependencies (#404) 2021-02-04 01:52:53 +00:00
Excavator Bot
a4390e0cf0
Excavator: Upgrade buildscript dependencies (#403) 2021-02-02 09:54:37 +00:00
Excavator Bot
0374f38e84
Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#402) 2021-02-02 08:04:08 +00:00
Excavator Bot
f2bd5576ba
Excavator: Upgrade buildscript dependencies (#401)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-12-18 06:24:10 +00:00
Excavator Bot
eb4259d41a
Excavator: Upgrade buildscript dependencies (#397)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-10-29 15:45:09 +00:00
svc-autorelease
38bc433b1e
Autorelease 0.7.2 2020-10-29 15:36:38 +00:00
Dennis Dierkes
dac18d3bfe
Bump default graal version to 20.2.0 (#396)
* Bump default graal version to 20.2.0

This fixes a problem with projects that make use of the kotlin coroutines.
More details: https://github.com/oracle/graal/issues/366

* Add changelog
2020-10-29 15:36:34 +00:00
Dennis Dierkes
5f85487cc0
Fix substrate vm link (#395) 2020-10-29 13:30:43 +00:00
iamdanfox
e71773deb3
Don't publish snapshots to gradle plugin portal (#392)
Snapshots are no longer published to gradle plugin portal
2020-10-01 12:07:26 +00:00
Excavator Bot
113a84d057
Excavator: Upgrade buildscript dependencies (#387)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-08-29 05:47:50 +00:00
Excavator Bot
ba0017b71b
Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#386)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-08-28 00:03:02 +00:00
Excavator Bot
82bbc91fe9
Excavator: Upgrade buildscript dependencies (#385)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-08-27 18:18:37 +00:00
Excavator Bot
235d3be83f
Excavator: Upgrade buildscript dependencies (#384)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-08-27 03:42:35 +00:00
Excavator Bot
b4461f984b
Excavator: Upgrade buildscript dependencies (#382)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-08-24 22:27:41 +00:00
Excavator Bot
62b50909e5
Excavator: Upgrade buildscript dependencies (#381)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-08-21 21:28:22 +00:00
Excavator Bot
8d2839429d
Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#380)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-08-20 07:18:50 +00:00
Excavator Bot
d190241cf6
Excavator: Upgrade buildscript dependencies (#378)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-08-12 21:41:44 +00:00
Excavator Bot
028cd7889e
Excavator: Render Bulldozer Bot config file (#375)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-07-29 14:06:25 +00:00
Excavator Bot
42f66e6db1
Excavator: Upgrade buildscript dependencies (#372)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-07-25 19:38:13 +00:00
Excavator Bot
d3690b4c79
Excavator: Upgrade buildscript dependencies (#368)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-07-09 01:39:53 +00:00
Excavator Bot
ced34a050b
Excavator: Ensure consistent PULL_REQUEST_TEMPLATE.md (#367)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-06-30 23:15:18 +00:00
Excavator Bot
98afa4ebba
Excavator: Format Java files (#366)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-06-29 21:35:23 +00:00
Excavator Bot
33626dd019
Excavator: Upgrade buildscript dependencies (#364)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-06-26 00:40:26 +00:00
Excavator Bot
dee37d2dc0
Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#365)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-06-26 00:40:12 +00:00
Excavator Bot
a54f4db5d1
Excavator: Upgrade buildscript dependencies (#363)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-06-23 17:37:15 +00:00
Excavator Bot
8103679fd7
Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#362)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-06-20 03:38:23 +00:00
Excavator Bot
355927ab75
Excavator: Upgrade buildscript dependencies (#361)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-06-20 03:32:43 +00:00
Excavator Bot
f4abf43a02
Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#358)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-06-16 21:51:21 +00:00
Excavator Bot
e3cefe82f2
Excavator: Upgrade buildscript dependencies (#357)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-06-16 21:48:45 +00:00
Carter Kozak
ad1c935f0c
Autorelease 0.7.1 2020-06-01 19:43:49 +00:00
Carter Kozak
168ed96708
Fix gu on Windows and multi-module project path (#354)
Fix `gu` on Windows and multi-module project path
2020-06-01 15:02:39 +00:00
Mariano de Achaval
3c87deed6e
Fixes #352 and also fixes #344 (#353) 2020-06-01 14:47:21 +00:00
Excavator Bot
838c2ab11f
Excavator: Upgrade buildscript dependencies (#350)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-05-29 21:43:28 +00:00
Excavator Bot
4557aa6eb3
Excavator: Upgrade dependencies (#349)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-05-29 21:41:18 +00:00
Excavator Bot
79c0161a97
Excavator: Upgrade buildscript dependencies (#348)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-05-28 21:26:11 +00:00
Excavator Bot
4a93d003d5
Excavator: Update open-source publishing plugins (#347)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-05-26 19:50:48 +00:00
Excavator Bot
3ba831ee86
Excavator: Upgrade buildscript dependencies (#346)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-05-21 19:35:17 +00:00
Carter Kozak
3740bcb672
Update circle config to fix publish (#342)
Update circle config to fix publish
2020-05-19 17:20:17 +00:00
Excavator Bot
4caa6153f9
Excavator: Upgrade buildscript dependencies (#343)
Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>
2020-05-19 16:53:58 +00:00
Carter Kozak
ee6aa0c5eb
Autorelease 0.6.1 2020-05-18 16:25:43 +00:00
Carter Kozak
6858c84823
Fixup changelog dir (#341) 2020-05-18 12:25:37 -04:00
Daniel Mühlbachler
7e9bcf1bbd
fix #239 - add property javaVersion to support GraalVM 19.3+ (#255)
* fix #239 - add property javaVersion to support GraalVM 19.3+

* fix download / tests that use the new Java version cache subdir

* fix #239 - use VS 2019 for Java 11+ and add Java 11 E2E tests

* fix #239 - add options to specify VS path

* fix #239 - require JDK 8 and JDK 11 tests

* add automatic detection of Visual Studio installation

* update readme.md for the new GraalVM 19.3+ support

* fix #239 - autodetect vs path and throw exception

* fix #239 - detect vs vars path but fail when needed

* fix #239 - rename VS and Windows related variables and method to contain windows for clarity

* format

* changelog

Co-authored-by: David Kirstein <dak@batix.com>
Co-authored-by: Cosmin Polifronie <cosmin.polifronie@gmail.com>
Co-authored-by: Carter Kozak <ckozak@ckozak.net>
2020-05-18 16:16:39 +00:00
37 changed files with 1414 additions and 404 deletions

View file

@ -1,15 +1,9 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Palantir Baseline Checkstyle configuration. Palantir Baseline Checkstyle configuration.
Authors: Robert Fink, Brian Worth, Merrick Zoubeiri, and many other contributors. Based in part on http://checkstyle.sourceforge.net/google_style.html Authors: Robert Fink, Brian Worth, Merrick Zoubeiri, and many other contributors. Based in part on http://checkstyle.sourceforge.net/google_style.html
Please keep checks alphabetized with one exception: "relaxed" checks are grouped together at the bottom for easier disabling. Please keep checks alphabetized with one exception: "relaxed" checks are grouped together at the bottom for easier disabling.
Check-specific comments reference documents internal to Palantir and can be safely ignored or removed. Check-specific comments reference documents internal to Palantir and can be safely ignored or removed.
--> --><!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker"> <module name="Checker">
<property name="charset" value="UTF-8"/> <property name="charset" value="UTF-8"/>
<property name="severity" value="error"/> <property name="severity" value="error"/>
@ -18,15 +12,6 @@
<module name="NewlineAtEndOfFile"> <!-- Java Style Guide: Line ending: LF --> <module name="NewlineAtEndOfFile"> <!-- Java Style Guide: Line ending: LF -->
<property name="lineSeparator" value="lf"/> <property name="lineSeparator" value="lf"/>
</module> </module>
<module name="RegexpHeader">
<property name="header" value="^/\*$\n^ \* \(c\) Copyright \d{4} Palantir Technologies Inc\. All rights reserved\.$"/>
<property name="fileExtensions" value=".java,.ts"/>
</module>
<module name="RegexpMultiline"> <!-- Development Practices: Writing good unit tests -->
<property name="fileExtensions" value="java"/>
<property name="format" value="@VisibleForTesting\s+(protected|public)"/>
<property name="message" value="@VisibleForTesting members should be package-private."/>
</module>
<module name="RegexpSingleline"> <!-- No reference needed as this is evident. --> <module name="RegexpSingleline"> <!-- No reference needed as this is evident. -->
<property name="format" value="&lt;&lt;&lt;&lt;&lt;&lt;&lt;"/> <property name="format" value="&lt;&lt;&lt;&lt;&lt;&lt;&lt;"/>
<property name="message" value="Found (&lt;&lt;&lt;&lt;&lt;&lt;&lt;), so it looks like you had a merge conflict that compiles. Please fix it."/> <property name="message" value="Found (&lt;&lt;&lt;&lt;&lt;&lt;&lt;), so it looks like you had a merge conflict that compiles. Please fix it."/>
@ -56,6 +41,10 @@
<module name="BeforeExecutionExclusionFileFilter"> <module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/> <property name="fileNamePattern" value="module\-info\.java$"/>
</module> </module>
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://|\{@link"/>
</module>
<module name="TreeWalker"> <module name="TreeWalker">
<module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md --> <module name="SuppressionCommentFilter"/> <!-- baseline-gradle: README.md -->
<module name="SuppressionCommentFilter"> <module name="SuppressionCommentFilter">
@ -74,7 +63,9 @@
<property name="tokens" value="VARIABLE_DEF"/> <property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/> <property name="allowSamelineMultipleAnnotations" value="true"/>
</module> </module>
<module name="AnnotationUseStyle"/> <!-- Java Style Guide: Annotations --> <module name="AnnotationUseStyle"> <!-- Java Style Guide: Annotations -->
<property name="trailingArrayComma" value="ignore"/>
</module>
<module name="ArrayTypeStyle"/> <!-- Java Style Guide: No C-style array declarations --> <module name="ArrayTypeStyle"/> <!-- Java Style Guide: No C-style array declarations -->
<module name="AvoidEscapedUnicodeCharacters"> <!-- Java Style Guide: Non-ASCII characters --> <module name="AvoidEscapedUnicodeCharacters"> <!-- Java Style Guide: Non-ASCII characters -->
<property name="allowEscapesForControlCharacters" value="true"/> <property name="allowEscapesForControlCharacters" value="true"/>
@ -86,14 +77,7 @@
</module> </module>
<module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports --> <module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
<module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports --> <module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
<property name="excludes" value=" <property name="excludes" value="com.google.common.base.Preconditions.*, com.palantir.logsafe.Preconditions.*, java.util.Collections.*, java.util.stream.Collectors.*, org.apache.commons.lang3.Validate.*, org.assertj.core.api.Assertions.*, org.mockito.Mockito.*"/>
com.google.common.base.Preconditions.*,
com.palantir.logsafe.Preconditions.*,
java.util.Collections.*,
java.util.stream.Collectors.*,
org.apache.commons.lang3.Validate.*,
org.assertj.core.api.Assertions.*,
org.mockito.Mockito.*"/>
</module> </module>
<module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names --> <module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/> <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
@ -143,12 +127,12 @@
<module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package --> <module name="IllegalImport"> <!-- Java Coding Guidelines: Import the canonical package -->
<property name="id" value="BanShadedClasses"/> <property name="id" value="BanShadedClasses"/>
<property name="illegalPkgs" value=".*\.(repackaged|shaded|thirdparty)"/> <property name="illegalPkgs" value=".*\.(repackaged|shaded|thirdparty)"/>
<property name="regexp" value="true" /> <property name="regexp" value="true"/>
<message key="import.illegal" value="Must not import repackaged classes."/> <message key="import.illegal" value="Must not import repackaged classes."/>
</module> </module>
<module name="IllegalImport"> <module name="IllegalImport">
<property name="illegalPkgs" value="^org\.gradle\.(internal|.*\.internal)"/> <property name="illegalPkgs" value="^org\.gradle\.(internal|.*\.internal)"/>
<property name="regexp" value="true" /> <property name="regexp" value="true"/>
<message key="import.illegal" value="Do not rely on gradle internal classes as these may change in minor releases - use org.gradle.api versions instead."/> <message key="import.illegal" value="Do not rely on gradle internal classes as these may change in minor releases - use org.gradle.api versions instead."/>
</module> </module>
<module name="IllegalImport"> <module name="IllegalImport">
@ -201,12 +185,9 @@
<property name="separated" value="true"/> <property name="separated" value="true"/>
<property name="sortStaticImportsAlphabetically" value="true"/> <property name="sortStaticImportsAlphabetically" value="true"/>
</module> </module>
<module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used --> <module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used -->
<module name="LeftCurly"/> <!-- Java Style Guide: Nonempty blocks: K & R style --> <!-- Java Style Guide: Nonempty blocks: K & R style -->
<module name="LineLength"> <!-- Java Style Guide: No line-wrapping -->
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="MemberName"> <!-- Java Style Guide: Non-constant field names --> <module name="MemberName"> <!-- Java Style Guide: Non-constant field names -->
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/> <property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/> <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
@ -247,7 +228,7 @@
<message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/> <message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="ParameterAssignment"/> <!-- Java Coding Guidelines: Final variables and parameters --> <module name="ParameterAssignment"/> <!-- Java Coding Guidelines: Final variables and parameters -->
<module name="ParenPad"/> <!-- Java Style Guide: Horizontal whitespace --> <!-- Java Style Guide: Horizontal whitespace -->
<module name="RedundantImport"/> <!-- Java Style Guide: No unused imports --> <module name="RedundantImport"/> <!-- Java Style Guide: No unused imports -->
<module name="RedundantModifier"/> <!-- Java Coding Guidelines: Avoid redundant modifiers --> <module name="RedundantModifier"/> <!-- Java Coding Guidelines: Avoid redundant modifiers -->
<module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods --> <module name="RegexpSinglelineJava"> <!-- Java Coding Guidelines: Use appropriate assertion methods -->
@ -363,7 +344,7 @@
</module> </module>
<module name="RegexpSinglelineJava"> <module name="RegexpSinglelineJava">
<property name="format" value="\bCharset.defaultCharset\("/> <property name="format" value="\bCharset.defaultCharset\("/>
<property name="message" value="Use explicit charset (e.g. StandardCharsets.UTF-8) instead of default."/> <property name="message" value="Use explicit charset (e.g. StandardCharsets.UTF_8) instead of default."/>
</module> </module>
<module name="RegexpSinglelineJava"> <module name="RegexpSinglelineJava">
<property name="format" value="\bIOUtils\.toString\("/> <property name="format" value="\bIOUtils\.toString\("/>
@ -372,6 +353,7 @@
<module name="RegexpSinglelineJava"> <module name="RegexpSinglelineJava">
<property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/> <property name="format" value="\/\/TODO|\/\/ TODO(?!\([^()\s]+\): )"/>
<property name="message" value="TODO format: // TODO(#issue): explanation"/> <property name="message" value="TODO format: // TODO(#issue): explanation"/>
<property name="ignoreCase" value="true"/>
</module> </module>
<module name="RegexpSinglelineJava"> <module name="RegexpSinglelineJava">
<property name="format" value="(void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))"/> <property name="format" value="(void setUp\(\))|(void setup\(\))|(void setupStatic\(\))|(void setUpStatic\(\))|(void beforeTest\(\))|(void teardown\(\))|(void tearDown\(\))|(void beforeStatic\(\))|(void afterStatic\(\))"/>
@ -379,11 +361,11 @@
</module> </module>
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style --> <module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
<property name="option" value="same"/> <property name="option" value="same"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/> <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
</module> </module>
<module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style --> <module name="RightCurly"> <!-- Java Style Guide: Nonempty blocks: K & R style -->
<property name="option" value="alone"/> <property name="option" value="alone"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/> <property name="tokens" value="LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
</module> </module>
<module name="SeparatorWrap"> <!-- Java Style Guide: Where to break --> <module name="SeparatorWrap"> <!-- Java Style Guide: Where to break -->
<property name="tokens" value="DOT"/> <property name="tokens" value="DOT"/>
@ -401,28 +383,18 @@
<module name="SuppressWarnings"> <module name="SuppressWarnings">
<property name="format" value="serial"/> <property name="format" value="serial"/>
</module> </module>
<module name="SuppressWarningsHolder" /> <!-- Required for SuppressWarningsFilter --> <module name="SuppressWarningsHolder"/> <!-- Required for SuppressWarningsFilter -->
<module name="TypeName"> <!-- Java Style Guide: Class names --> <module name="TypeName"> <!-- Java Style Guide: Class names -->
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/> <message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="TypecastParenPad"/> <!-- Java Style Guide: Horizontal whitespace --> <module name="TypecastParenPad"/> <!-- Java Style Guide: Horizontal whitespace -->
<module name="UnnecessaryParentheses"/>
<module name="UnusedImports"> <!-- Java Style Guide: No unused imports --> <module name="UnusedImports"> <!-- Java Style Guide: No unused imports -->
<property name="processJavadoc" value="true"/> <property name="processJavadoc" value="true"/>
</module> </module>
<module name="UpperEll"/> <!-- Java Style Guide: Numeric Literals --> <module name="UpperEll"/> <!-- Java Style Guide: Numeric Literals -->
<module name="VisibilityModifier"/> <!-- Java Coding Guidelines: Minimize mutability --> <module name="VisibilityModifier"/> <!-- Java Coding Guidelines: Minimize mutability -->
<module name="WhitespaceAfter"/> <!-- Java Style Guide: Horizontal whitespace --> <module name="WhitespaceAfter"/> <!-- Java Style Guide: Horizontal whitespace -->
<module name="WhitespaceAround"> <!-- Java Style Guide: Horizontal whitespace -->
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="ignoreEnhancedForColon" value="false"/>
<message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<!-- Stricter checks begin: delete some or all of the following for faster prototyping, but please restore before pushing to production. --> <!-- Stricter checks begin: delete some or all of the following for faster prototyping, but please restore before pushing to production. -->
@ -430,18 +402,17 @@
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/> <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/> <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module> </module>
<module name="CyclomaticComplexity"/> <!-- Java Coding Guidelines: Reduce Cyclomatic Complexity --> <module name="CyclomaticComplexity"> <!-- Java Coding Guidelines: Reduce Cyclomatic Complexity -->
<property name="switchBlockAsSingleDecisionPoint" value="true"/>
</module>
<module name="DesignForExtension"> <!-- Java Coding Guidelines: Design for extension --> <module name="DesignForExtension"> <!-- Java Coding Guidelines: Design for extension -->
<property name="ignoredAnnotations" value="ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/> <property name="ignoredAnnotations" value="ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
</module> </module>
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used --> <module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
<property name="scope" value="public"/> <property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/> <property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/> <property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="99999999"/>
<property name="allowedAnnotations" value="Override, Test"/> <property name="allowedAnnotations" value="Override, Test"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module> </module>
<module name="JavadocStyle"/> <!-- Java Style Guide: Javadoc --> <module name="JavadocStyle"/> <!-- Java Style Guide: Javadoc -->
<module name="JavadocTagContinuationIndentation"> <!-- Java Style Guide: At-clauses --> <module name="JavadocTagContinuationIndentation"> <!-- Java Style Guide: At-clauses -->
@ -474,4 +445,4 @@
<!-- Stricter checks end --> <!-- Stricter checks end -->
</module> </module>
</module> </module>

View file

@ -8,9 +8,9 @@ org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=; org.eclipse.jdt.ui.importorder=;
org.eclipse.jdt.ui.javadoc=false org.eclipse.jdt.ui.javadoc=false
org.eclipse.jdt.ui.keywordthis=false org.eclipse.jdt.ui.keywordthis=false
org.eclipse.jdt.ui.ondemandthreshold=99 org.eclipse.jdt.ui.ondemandthreshold=999
org.eclipse.jdt.ui.overrideannotation=true org.eclipse.jdt.ui.overrideannotation=true
org.eclipse.jdt.ui.staticondemandthreshold=99 org.eclipse.jdt.ui.staticondemandthreshold=999
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment"/><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\n * (c) Copyright ${year} Palantir Technologies Inc. All rights reserved.\n */\n\n${package_declaration}\n\n/**\n * \n */\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">throw new RuntimeException(${exception_var});</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment"/><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\n * (c) Copyright ${year} Palantir Technologies Inc. All rights reserved.\n */\n\n${package_declaration}\n\n/**\n * \n */\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">throw new RuntimeException(${exception_var});</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
sp_cleanup.add_default_serial_version_id=true sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false sp_cleanup.add_generated_serial_version_id=false

View file

@ -16,7 +16,7 @@
<option name="BINARY_OPERATION_WRAP" value="1" /> <option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" /> <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
<option name="CALL_PARAMETERS_WRAP" value="1" /> <option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="DOWHILE_BRACE_FORCE" value="3" /> <option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" /> <option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" /> <option name="EXTENDS_LIST_WRAP" value="1" />
@ -30,9 +30,10 @@
<package name="" static="false" withSubpackages="true" /> <package name="" static="false" withSubpackages="true" />
</value> </value>
</option> </option>
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
<GroovyCodeStyleSettings> <GroovyCodeStyleSettings>
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value /> <value />
</option> </option>
@ -43,6 +44,21 @@
<package name="" withSubpackages="true" static="false" /> <package name="" withSubpackages="true" static="false" />
</value> </value>
</option> </option>
<!-- Should be a superset of https://github.com/google/error-prone/blob/c481b3f9c2da112db36ccfcbf64e755261a127ab/core/src/main/java/com/google/errorprone/bugpatterns/BadImport.java#L63 -->
<DO_NOT_IMPORT_INNER>
<CLASS name="Builder" />
<CLASS name="BuilderFactory" />
<CLASS name="Callback" />
<CLASS name="Class" />
<CLASS name="Entry" />
<CLASS name="Enum" />
<CLASS name="Factory" />
<CLASS name="Type" />
<CLASS name="Key" />
<CLASS name="Id" />
<CLASS name="Identifier" />
<CLASS name="Provider" />
</DO_NOT_IMPORT_INNER>
</GroovyCodeStyleSettings> </GroovyCodeStyleSettings>
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" /> <option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" /> <option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
@ -55,7 +71,7 @@
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" /> <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" /> <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" /> <option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" /> <option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
<option name="OTHER_INDENT_OPTIONS"> <option name="OTHER_INDENT_OPTIONS">
<value> <value>

View file

@ -2,9 +2,9 @@
version: 1 version: 1
merge: merge:
whitelist: trigger:
labels: ["merge when ready"] labels: ["merge when ready"]
blacklist: ignore:
labels: ["do not merge"] labels: ["do not merge"]
method: squash method: squash
options: options:
@ -13,5 +13,5 @@ merge:
message_delimiter: ==COMMIT_MSG== message_delimiter: ==COMMIT_MSG==
delete_after_merge: true delete_after_merge: true
update: update:
whitelist: trigger:
labels: ["update me"] labels: ["update me"]

View file

@ -1,74 +1,148 @@
version: 2 # This file was generated by the excavator check 'excavator/manage-circleci' as specified in .circleci/template.sh.
# To request a modification to the general template, file an issue on Excavator.
# To manually manage the CircleCI configuration for this project, remove the .circleci/template.sh file.
version: 2.1
jobs: jobs:
compile:
docker: [{ image: 'circleci/openjdk:8-node' }]
resource_class: medium+
steps:
- checkout
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --profile --parallel --stacktrace resolveConfigurations
- save_cache:
key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
paths: [ ~/.gradle/wrapper ]
- save_cache:
key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- run: ./gradlew --profile --parallel --stacktrace classes testClasses
- persist_to_workspace:
root: .
paths: [ . ]
check: check:
docker: [{ image: 'circleci/openjdk:8-node' }] docker: [{ image: 'cimg/openjdk:11.0.10-node' }]
resource_class: medium+ resource_class: large
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.workers.max=2 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
_JAVA_OPTIONS: -XX:ActiveProcessorCount=4 -XX:MaxRAM=8g -XX:+CrashOnOutOfMemoryError -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps: steps:
- attach_workspace: { at: . } - checkout
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - run:
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } name: delete_unrelated_tags
- restore_cache: { key: 'graal-cache' } command: |
- run: sudo apt-get update && sudo apt-get install build-essential zlib1g-dev ALL_TAGS=$(git tag --points-at HEAD)
- run: ./gradlew --profile --parallel --stacktrace --continue check
if [ -z "$ALL_TAGS" ]; then
echo "No-op as there are no tags on the current commit ($(git rev-parse HEAD))"
exit 0
fi
if [ -z "${CIRCLE_TAG:+x}" ]; then
echo "Non-tag build, deleting all tags which point to HEAD: [${ALL_TAGS/$'\n'/,}]"
echo "$ALL_TAGS" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
exit 0
fi
TAGS_TO_DELETE=$(echo "$ALL_TAGS" | grep -v "^$CIRCLE_TAG$" || :)
if [ -z "$TAGS_TO_DELETE" ]; then
echo "No-op as exactly one tag ($CIRCLE_TAG) points to HEAD"
exit 0
fi
echo "Detected tag build, deleting all tags except '$CIRCLE_TAG' which point to HEAD: [${TAGS_TO_DELETE/$'\n'/,}]"
echo "$TAGS_TO_DELETE" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
- restore_cache: { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'check-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run:
name: check-setup
command: |
if [ -x .circleci/check-setup.sh ]; then
echo "Running check-setup" && .circleci/check-setup.sh && echo "check-setup complete"
fi
- run: ./gradlew --parallel --stacktrace --continue --max-workers=2 check -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
- persist_to_workspace:
root: /home/circleci
paths: [ project ]
- save_cache: - save_cache:
key: 'graal-cache' key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}'
paths: [ ~/.gradle/caches/com.palantir.graal ] paths: [ ~/.gradle/wrapper ]
- store_test_results: { path: build/test-results } - save_cache:
- store_artifacts: { path: build/reports/tests } key: 'check-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- run:
command: mkdir -p ~/junit && find . -type f -regex ".*/build/.*TEST.*xml" -exec cp --parents {} ~/junit/ \;
when: always
- store_test_results: { path: ~/junit }
- store_artifacts: { path: ~/artifacts }
trial-publish: trial-publish:
docker: [{ image: 'circleci/openjdk:8-node' }] docker: [{ image: 'cimg/openjdk:11.0.10-node' }]
resource_class: medium
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
_JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:+CrashOnOutOfMemoryError -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps: steps:
- attach_workspace: { at: . } - checkout
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - run:
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } name: delete_unrelated_tags
- run: ./gradlew --profile --stacktrace publishToMavenLocal command: |
ALL_TAGS=$(git tag --points-at HEAD)
if [ -z "$ALL_TAGS" ]; then
echo "No-op as there are no tags on the current commit ($(git rev-parse HEAD))"
exit 0
fi
if [ -z "${CIRCLE_TAG:+x}" ]; then
echo "Non-tag build, deleting all tags which point to HEAD: [${ALL_TAGS/$'\n'/,}]"
echo "$ALL_TAGS" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
exit 0
fi
TAGS_TO_DELETE=$(echo "$ALL_TAGS" | grep -v "^$CIRCLE_TAG$" || :)
if [ -z "$TAGS_TO_DELETE" ]; then
echo "No-op as exactly one tag ($CIRCLE_TAG) points to HEAD"
exit 0
fi
echo "Detected tag build, deleting all tags except '$CIRCLE_TAG' which point to HEAD: [${TAGS_TO_DELETE/$'\n'/,}]"
echo "$TAGS_TO_DELETE" | while read -r TAG; do git tag -d "$TAG" 1>/dev/null; done
- restore_cache: { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'trial-publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- run: ./gradlew --stacktrace publishToMavenLocal -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
- run:
command: git status --porcelain
when: always
- save_cache:
key: 'trial-publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- store_test_results: { path: ~/junit }
- store_artifacts: { path: ~/artifacts }
publish: publish:
docker: [{ image: 'circleci/openjdk:8-node' }] docker: [{ image: 'cimg/openjdk:11.0.10-node' }]
resource_class: medium
environment:
CIRCLE_TEST_REPORTS: /home/circleci/junit
CIRCLE_ARTIFACTS: /home/circleci/artifacts
GRADLE_OPTS: -Dorg.gradle.workers.max=1 -Dorg.gradle.jvmargs='-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
_JAVA_OPTIONS: -XX:ActiveProcessorCount=2 -XX:MaxRAM=4g -XX:+CrashOnOutOfMemoryError -XX:ErrorFile=/home/circleci/artifacts/hs_err_pid%p.log -XX:HeapDumpPath=/home/circleci/artifacts
steps: steps:
- attach_workspace: { at: . } - attach_workspace: { at: /home/circleci }
- restore_cache: { key: 'gradle-wrapper-v2-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' } - restore_cache: { key: 'gradle-wrapper-v1-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}' }
- restore_cache: { key: 'gradle-cache-v2-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' } - restore_cache: { key: 'publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}' }
- deploy: - deploy:
command: ./gradlew --profile --parallel --stacktrace --continue publish command: ./gradlew --parallel --stacktrace --continue publish -Porg.gradle.java.installations.fromEnv=JAVA_8_HOME,JAVA_11_HOME,JAVA_15_HOME,JAVA_17_HOME,JAVA_HOME
- deploy: - run:
command: ./gradlew --profile --parallel --stacktrace -Pgradle.publish.key=$GRADLE_KEY -Pgradle.publish.secret=$GRADLE_SECRET publishPlugins command: git status --porcelain
when: always
- save_cache:
key: 'publish-gradle-cache-v1-{{ checksum "versions.props" }}-{{ checksum "build.gradle" }}'
paths: [ ~/.gradle/caches ]
- store_test_results: { path: ~/junit }
- store_artifacts: { path: ~/artifacts }
workflows: workflows:
version: 2 version: 2
build: build:
jobs: jobs:
- compile:
filters: { tags: { only: /.*/ } }
- check: - check:
requires: [ compile ]
filters: { tags: { only: /.*/ } } filters: { tags: { only: /.*/ } }
- trial-publish: - trial-publish:
requires: [ compile ] filters: { branches: { ignore: develop } }
- publish: - publish:
requires: [ check ] requires: [ check, trial-publish ]
filters: { tags: { only: /.*/ }, branches: { only: develop } } filters: { tags: { only: /.*/ }, branches: { only: develop } }

3
.circleci/template.sh Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
export CIRCLECI_TEMPLATE=java-library-oss
export JDK=11

View file

@ -7,3 +7,4 @@ auto-label:
tags: tags:
roomba: [ "merge when ready" ] roomba: [ "merge when ready" ]
automerge: [ "merge when ready" ] automerge: [ "merge when ready" ]
autorelease: [ "autorelease" ]

View file

@ -2,8 +2,8 @@
<!-- What's wrong with the current state of the world and why change it now? --> <!-- What's wrong with the current state of the world and why change it now? -->
## After this PR ## After this PR
<!-- User-facing outcomes this PR delivers go below -->
==COMMIT_MSG== ==COMMIT_MSG==
<!-- User-facing outcomes this PR delivers -->
==COMMIT_MSG== ==COMMIT_MSG==
## Possible downsides? ## Possible downsides?

View file

@ -3,12 +3,11 @@
policy: policy:
approval: approval:
- or: - or:
- infrastructure-notify has been notified
- one admin has approved (PR contributors not allowed) - one admin has approved (PR contributors not allowed)
- two admins have approved - two admins have approved
- changelog only and contributor approval - changelog only and contributor approval
- fixing excavator - fixing excavator
- excavator only touched baseline, circle, gradle files, godel files, docker-compose-rule config or versions.props - excavator only touched baseline, circle, gradle files, godel files, generated code, go dependencies, docker-compose-rule config or versions.props
- excavator only touched config files - excavator only touched config files
- bots updated package.json and lock files - bots updated package.json and lock files
disapproval: disapproval:
@ -16,15 +15,6 @@ policy:
organizations: [ "palantir" ] organizations: [ "palantir" ]
approval_rules: approval_rules:
- name: infrastructure-notify has been notified
options:
allow_contributor: false
request_review:
enabled: true
requires:
count: 1
teams: [ "palantir/infrastructure-notify" ]
- name: one admin has approved (PR contributors not allowed) - name: one admin has approved (PR contributors not allowed)
options: options:
allow_contributor: false allow_contributor: false
@ -60,7 +50,7 @@ approval_rules:
has_author_in: has_author_in:
users: [ "svc-excavator-bot" ] users: [ "svc-excavator-bot" ]
- name: excavator only touched baseline, circle, gradle files, godel files, docker-compose-rule config or versions.props - name: excavator only touched baseline, circle, gradle files, godel files, generated code, go dependencies, docker-compose-rule config or versions.props
requires: requires:
count: 0 count: 0
if: if:
@ -75,15 +65,24 @@ approval_rules:
- "^\\.circleci/.*$" - "^\\.circleci/.*$"
- "^\\.docker-compose-rule\\.yml$" - "^\\.docker-compose-rule\\.yml$"
- "^.*gradle$" - "^.*gradle$"
- "^\\.palantir/go-version$"
- "^gradle/wrapper/.*" - "^gradle/wrapper/.*"
- "^gradlew$" - "^gradlew$"
- "^gradlew.bat$" - "^gradlew.bat$"
- "^gradle.properties$" - "^gradle.properties$"
- "^settings.gradle$" - "^settings.gradle$"
- "^godelw$" - "^.*go.mod$"
- "^godel/config/godel.properties$" - "^.*go.sum$"
- "^.*godelw$"
- "^.*godel/config/godel.properties$"
- "^.*godel/config/godel.yml$"
- "^.*vendor/.*$"
- "^versions.props$" - "^versions.props$"
- "^versions.lock$" - "^versions.lock$"
- "^internal/generated/.*"
- "^internal/generated_src/.*"
has_valid_signatures_by_keys:
key_ids: ["C9AF124A484882E0"]
- name: excavator only touched config files - name: excavator only touched config files
requires: requires:
@ -95,6 +94,8 @@ approval_rules:
paths: paths:
- "^\\..*.yml$" - "^\\..*.yml$"
- "^\\.github/.*$" - "^\\.github/.*$"
has_valid_signatures_by_keys:
key_ids: ["C9AF124A484882E0"]
- name: bots updated package.json and lock files - name: bots updated package.json and lock files
requires: requires:
@ -108,3 +109,5 @@ approval_rules:
paths: paths:
- "^.*yarn.lock$" - "^.*yarn.lock$"
- "^.*package.json$" - "^.*package.json$"
has_valid_signatures_by_keys:
key_ids: ["C9AF124A484882E0"]

View file

@ -23,14 +23,20 @@ Configuration
Configure this plugin and its wrappers around GraalVM tools through the `graal` extension with the following options: Configure this plugin and its wrappers around GraalVM tools through the `graal` extension with the following options:
**General GraalVM controls** **General GraalVM controls**
* `graalVersion`: the version string to use when downloading GraalVM (defaults to `19.2.0`) * `graalVersion`: the version string to use when downloading GraalVM (defaults to `20.2.0`)
* `downloadBaseUrl`: the base download URL to use (defaults to `https://github.com/oracle/graal/releases/download/`) * `downloadBaseUrl`: the base download URL to use (defaults to `https://github.com/oracle/graal/releases/download/`)
* `javaVersion`: the Java version to use (can be either `8` or `11`, defaults to `8`)
* for `8`: Windows SDK 7.1 will be used (`C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd`)
* for `11`: Visual Studio Build Tools will be used (`C:\Program Files (x86)\Microsoft Visual Studio\{version}\\{edition}\\VC\\Auxiliary\\Build\\vcvars64.bat`)
* `windowsVsVersion`: the version of Visual Studio to use (can be either `2017` or `2019`, by default a search will be performed and the newest will be selected)
* `windowsVsEdition`: the edition of Visual Studio to use (can be either `Community`, `Professional` or `Enterprise`, by default a search will be performed and the biggest will be selected)
* `windowsVsVarsPath`: path to vcvars64.bat (optional, if it's set it will disable the 2 searches for `vsVersion` and `vsEdition`)
**`native-image` controls** **`native-image` controls**
* `outputName`: the name to use for the image output * `outputName`: the name to use for the image output
* `mainClass`: the main class entry-point for the image to run * `mainClass`: the main class entry-point for the image to run
* `option`: additional native-image options `https://github.com/oracle/graal/blob/master/substratevm/OPTIONS.md` * `option`: additional native-image options (see https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/Options.md)
Local GraalVM Tooling Cache Local GraalVM Tooling Cache
--------------------------- ---------------------------

View file

@ -13,67 +13,66 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import net.ltgt.gradle.errorprone.CheckSeverity
buildscript { buildscript {
repositories { repositories {
jcenter() mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
gradlePluginPortal() gradlePluginPortal() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
maven { url 'https://palantir.bintray.com/releases'}
} }
dependencies { dependencies {
classpath 'com.palantir.javaformat:gradle-palantir-java-format:1.0.0' classpath 'com.palantir.jakartapackagealignment:jakarta-package-alignment:0.5.0'
classpath 'com.netflix.nebula:gradle-info-plugin:7.1.4' classpath 'com.palantir.gradle.jdks:gradle-jdks:0.31.0'
classpath 'com.gradle.publish:plugin-publish-plugin:0.11.0' classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.7.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5' classpath 'com.gradle.publish:plugin-publish-plugin:1.1.0'
classpath 'com.netflix.nebula:nebula-publishing-plugin:17.2.1' classpath 'com.palantir.baseline:gradle-baseline-java:4.188.0'
classpath 'com.palantir.baseline:gradle-baseline-java:2.49.1' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.12.0'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.17.3' classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.11.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.3' classpath 'com.palantir.gradle.gitversion:gradle-git-version:1.0.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.3.0' classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.28.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0'
} }
} }
allprojects {
apply plugin: 'com.palantir.jakarta-package-alignment'
repositories {
jcenter()
gradlePluginPortal()
maven { url 'https://palantir.bintray.com/releases'}
} }
apply plugin: 'com.gradle.plugin-publish'
apply plugin: 'com.palantir.baseline'
apply plugin: 'com.palantir.git-version'
apply plugin: 'com.palantir.consistent-versions'
apply plugin: 'nebula.maven-publish'
apply plugin: 'nebula.source-jar'
apply plugin: 'org.inferred.processors'
apply plugin: 'java-gradle-plugin' apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy' apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'idea' apply plugin: 'idea'
apply plugin: 'com.palantir.baseline'
apply plugin: 'com.palantir.baseline-java-versions'
apply plugin: 'com.palantir.consistent-versions'
apply plugin: 'com.palantir.external-publish-gradle-plugin'
apply plugin: 'com.palantir.external-publish-jar'
apply plugin: 'com.palantir.git-version'
apply plugin: 'com.palantir.java-format' apply plugin: 'com.palantir.java-format'
apply from: "${rootDir}/gradle/bintray-publish.gradle" apply plugin: 'com.palantir.jdks.latest'
apply plugin: 'org.inferred.processors'
group 'com.palantir.graal' group 'com.palantir.graal'
version gitVersion() version gitVersion()
dependencies { repositories {
compile localGroovy() mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
compile gradleApi() }
testCompile gradleTestKit() dependencies {
testCompile 'com.netflix.nebula:nebula-test' implementation localGroovy()
testCompile 'com.squareup.okhttp3:mockwebserver' implementation gradleApi()
testImplementation gradleTestKit()
testImplementation 'com.netflix.nebula:nebula-test'
testImplementation 'com.squareup.okhttp3:mockwebserver'
} }
gradlePlugin { gradlePlugin {
// do not add new task to publish to plugins.gradle.org
automatedPublishing = false
plugins { plugins {
graal { graal {
id = 'com.palantir.graal' id = 'com.palantir.graal'
displayName = 'Palantir Graal Plugin'
implementationClass = 'com.palantir.gradle.graal.GradleGraalPlugin' implementationClass = 'com.palantir.gradle.graal.GradleGraalPlugin'
} }
} }
@ -84,18 +83,19 @@ pluginBundle {
vcsUrl = 'https://github.com/palantir/gradle-graal' vcsUrl = 'https://github.com/palantir/gradle-graal'
description = 'A plugin for Gradle that adds tasks to download, extract and interact with GraalVM tooling.' description = 'A plugin for Gradle that adds tasks to download, extract and interact with GraalVM tooling.'
tags = ['graal', 'native-image'] tags = ['graal', 'native-image']
}
plugins { tasks.withType(JavaCompile) {
graal { options.compilerArgs += ['-Werror']
id = 'com.palantir.graal' options.errorprone {
displayName = 'Palantir Graal Plugin' check("PreferSafeLogger", CheckSeverity.OFF)
} check("PreferSafeLoggingPreconditions", CheckSeverity.OFF)
check("PreferSafeLoggableExceptions", CheckSeverity.OFF)
check("Slf4jLogsafeArgs", CheckSeverity.OFF)
} }
} }
tasks.withType(JavaCompile).configureEach { javaVersions {
options.errorprone.errorproneArgs += [ libraryTarget = 11
'-Xep:PreferSafeLoggableExceptions:OFF', runtime = 17
'-Xep:PreferSafeLoggingPreconditions:OFF',
]
} }

View file

@ -0,0 +1,5 @@
type: improvement
improvement:
description: Publish to gradle plugin portal
links:
- https://github.com/palantir/gradle-graal/pull/485

View file

@ -0,0 +1,6 @@
type: feature
feature:
description: Add property javaVersion to support GraalVM 19.3+
links:
- https://github.com/palantir/dialogue/pull/255
- https://github.com/palantir/dialogue/pull/239

View file

@ -0,0 +1,7 @@
type: fix
fix:
description: Fix gu on Windows and multi-module project path.
links:
- https://github.com/palantir/gradle-graal/pull/353
- https://github.com/palantir/gradle-graal/issues/352
- https://github.com/palantir/gradle-graal/issues/344

View file

@ -0,0 +1,5 @@
type: improvement
improvement:
description: Bump default graal version to 20.2.0
links:
- https://github.com/palantir/gradle-graal/pull/396

View file

@ -0,0 +1,5 @@
type: feature
feature:
description: Support Java 16 for GraalVM 21.1.0 and greater
links:
- https://github.com/palantir/gradle-graal/pull/432

View file

View file

@ -1,2 +1,8 @@
org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true
com.palantir.baseline-versions.disable = true

Binary file not shown.

View file

@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

286
gradlew vendored
View file

@ -1,7 +1,7 @@
#!/usr/bin/env sh #!/bin/sh
# #
# Copyright 2015 the original author or authors. # Copyright © 2015-2021 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,78 +17,113 @@
# #
############################################################################## ##############################################################################
## #
## Gradle start up script for UN*X # 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/subprojects/plugins/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 # Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" # Resolve links: $0 may be a link
APP_BASE_NAME=`basename "$0"` 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##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # 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"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD=maximum
warn () { warn () {
echo "$*" echo "$*"
} } >&2
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} } >&2
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$( uname )" in #(
CYGWIN* ) CYGWIN* ) cygwin=true ;; #(
cygwin=true Darwin* ) darwin=true ;; #(
;; MSYS* | MINGW* ) msys=true ;; #(
Darwin* ) NONSTOP* ) nonstop=true ;;
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD=$JAVA_HOME/jre/sh/java
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD=$JAVA_HOME/bin/java
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. which java >/dev/null 2>&1 || 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 Please set the JAVA_HOME variable in your environment to match the
@ -105,84 +140,105 @@ location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
MAX_FD_LIMIT=`ulimit -H -n` case $MAX_FD in #(
if [ $? -eq 0 ] ; then max*)
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
MAX_FD="$MAX_FD_LIMIT" # shellcheck disable=SC3045
fi MAX_FD=$( ulimit -H -n ) ||
ulimit -n $MAX_FD warn "Could not query maximum file descriptor limit"
if [ $? -ne 0 ] ; then esac
warn "Could not set maximum file descriptor limit: $MAX_FD" case $MAX_FD in #(
fi '' | soft) :;; #(
else *)
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
fi # shellcheck disable=SC3045
fi ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
# Escape application args # Collect all arguments for the java command, stacking in reverse order:
save () { # * args from the command line
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done # * the main class name
echo " " # * -classpath
} # * -D...appname settings
APP_ARGS=$(save "$@") # * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules # For Cygwin or MSYS, switch paths to Windows format before running java
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong JAVACMD=$( cygpath --unix "$JAVACMD" )
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")" # 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 fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
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" "$@" exec "$JAVACMD" "$@"

38
gradlew.bat vendored
View file

@ -14,7 +14,7 @@
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem Gradle startup script for Windows
@ -25,10 +25,14 @@
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% 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. @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" set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@ -37,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if %ERRORLEVEL% equ 0 goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -51,7 +55,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@ -61,38 +65,26 @@ echo location of your Java installation.
goto fail goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 set EXIT_CODE=%ERRORLEVEL%
exit /b 1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal

View file

@ -28,6 +28,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.gradle.api.DefaultTask; import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.Configuration;
import org.gradle.api.file.RegularFile; import org.gradle.api.file.RegularFile;
import org.gradle.api.file.RegularFileProperty; import org.gradle.api.file.RegularFileProperty;
@ -47,9 +48,13 @@ public abstract class BaseGraalCompileTask extends DefaultTask {
private final ListProperty<String> options = getProject().getObjects().listProperty(String.class); private final ListProperty<String> options = getProject().getObjects().listProperty(String.class);
private final RegularFileProperty outputFile = getProject().getObjects().fileProperty(); private final RegularFileProperty outputFile = getProject().getObjects().fileProperty();
private final Property<String> graalVersion = getProject().getObjects().property(String.class); private final Property<String> graalVersion = getProject().getObjects().property(String.class);
private final Property<String> javaVersion = getProject().getObjects().property(String.class);
private final Property<String> windowsVsVarsPath = getProject().getObjects().property(String.class);
private final Property<Configuration> classpath = getProject().getObjects().property(Configuration.class); private final Property<Configuration> classpath = getProject().getObjects().property(Configuration.class);
private final RegularFileProperty jarFile = getProject().getObjects().fileProperty(); private final RegularFileProperty jarFile = getProject().getObjects().fileProperty();
private final Property<Path> cacheDir = getProject().getObjects().property(Path.class); private final Property<Path> cacheDir = getProject().getObjects().property(Path.class);
private final Property<String> graalDirectoryName =
getProject().getObjects().property(String.class);
public BaseGraalCompileTask() { public BaseGraalCompileTask() {
setGroup(GradleGraalPlugin.TASK_GROUP); setGroup(GradleGraalPlugin.TASK_GROUP);
@ -60,6 +65,7 @@ public abstract class BaseGraalCompileTask extends DefaultTask {
.map(d -> d.file(outputName.get() + getArchitectureSpecifiedOutputExtension()))); .map(d -> d.file(outputName.get() + getArchitectureSpecifiedOutputExtension())));
} }
@Input
protected abstract String getArchitectureSpecifiedOutputExtension(); protected abstract String getArchitectureSpecifiedOutputExtension();
protected final File maybeCreateOutputDirectory() throws IOException { protected final File maybeCreateOutputDirectory() throws IOException {
@ -68,9 +74,10 @@ public abstract class BaseGraalCompileTask extends DefaultTask {
return directory; return directory;
} }
@Input
protected final String getExecutable() { protected final String getExecutable() {
return cacheDir.get() return cacheDir.get()
.resolve(Paths.get(graalVersion.get(), "graalvm-ce-" + graalVersion.get())) .resolve(Paths.get(graalVersion.get(), javaVersion.get(), graalDirectoryName.get()))
.resolve(getArchitectureSpecifiedBinaryPath()) .resolve(getArchitectureSpecifiedBinaryPath())
.toFile() .toFile()
.getAbsolutePath(); .getAbsolutePath();
@ -146,9 +153,15 @@ public abstract class BaseGraalCompileTask extends DefaultTask {
outputRedirection = " >nul 2>&1"; outputRedirection = " >nul 2>&1";
} }
String argsString = spec.getArgs().stream().collect(Collectors.joining(" ", " ", "\r\n")); if (windowsVsVarsPath.get().isEmpty()) {
throw new GradleException("Couldn't find an installation of Windows SDK 7.1 suitable for GraalVM.");
}
String argsString =
spec.getArgs().stream().map(s -> "\"" + s + "\"").collect(Collectors.joining(" ", " ", "\r\n"));
String command = "call \"" + windowsVsVarsPath.get() + "\"";
String cmdContent = "@echo off\r\n" String cmdContent = "@echo off\r\n"
+ "call \"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Bin\\SetEnv.cmd\"" + command
+ outputRedirection + "\r\n" + outputRedirection + "\r\n"
+ "\"" + spec.getExecutable() + "\"" + argsString; + "\"" + spec.getExecutable() + "\"" + argsString;
Path buildPath = getProject().getBuildDir().toPath(); Path buildPath = getProject().getBuildDir().toPath();
@ -197,6 +210,24 @@ public abstract class BaseGraalCompileTask extends DefaultTask {
graalVersion.set(provider); graalVersion.set(provider);
} }
@Input
public final Provider<String> getJavaVersion() {
return javaVersion;
}
public final void setJavaVersion(Provider<String> provider) {
javaVersion.set(provider);
}
@Input
public final Provider<String> getWindowsVsVarsPath() {
return windowsVsVarsPath;
}
public final void setWindowsVsVarsPath(Provider<String> provider) {
windowsVsVarsPath.set(provider);
}
@InputFiles @InputFiles
@Classpath @Classpath
public final Provider<Configuration> getClasspath() { public final Provider<Configuration> getClasspath() {
@ -229,19 +260,16 @@ public abstract class BaseGraalCompileTask extends DefaultTask {
cacheDir.set(value); cacheDir.set(value);
} }
final void setGraalDirectoryName(Provider<String> value) {
graalDirectoryName.set(value);
}
public final void setOptions(Provider<List<String>> options) { public final void setOptions(Provider<List<String>> options) {
this.options.set(options); this.options.set(options);
} }
@Input
public final ListProperty<String> getOptions() { public final ListProperty<String> getOptions() {
return options; return options;
} }
public final RegularFileProperty getJarFile() {
return jarFile;
}
public final Property<Path> getCacheDir() {
return cacheDir;
}
} }

View file

@ -35,13 +35,14 @@ public class DownloadGraalTask extends DefaultTask {
// RC versions don't have a windows variant, so no [ext] is needed // RC versions don't have a windows variant, so no [ext] is needed
private static final String ARTIFACT_PATTERN_RC_VERSION = private static final String ARTIFACT_PATTERN_RC_VERSION =
"[url]/vm-[version]/graalvm-ce-[version]-[os]-[arch].tar.gz"; "[url]/vm-[version]/graalvm-ce-[javaVersion]-[version]-[os]-[arch].tar.gz";
private static final String ARTIFACT_PATTERN_RELEASE_VERSION = private static final String ARTIFACT_PATTERN_RELEASE_VERSION =
"[url]/vm-[version]/graalvm-ce-[os]-[arch]-[version].[ext]"; "[url]/vm-[version]/graalvm-ce-[javaVersion]-[os]-[arch]-[version].[ext]";
private static final String FILENAME_PATTERN = "graalvm-ce-[version]-[arch].[ext]"; private static final String FILENAME_PATTERN = "graalvm-ce-[javaVersion]-[version]-[arch].[ext]";
private final Property<String> graalVersion = getProject().getObjects().property(String.class); private final Property<String> graalVersion = getProject().getObjects().property(String.class);
private final Property<String> javaVersion = getProject().getObjects().property(String.class);
private final Property<String> downloadBaseUrl = getProject().getObjects().property(String.class); private final Property<String> downloadBaseUrl = getProject().getObjects().property(String.class);
private final Property<Path> cacheDir = getProject().getObjects().property(Path.class); private final Property<Path> cacheDir = getProject().getObjects().property(Path.class);
@ -49,13 +50,12 @@ public class DownloadGraalTask extends DefaultTask {
setGroup(GradleGraalPlugin.TASK_GROUP); setGroup(GradleGraalPlugin.TASK_GROUP);
setDescription("Downloads and caches GraalVM binaries."); setDescription("Downloads and caches GraalVM binaries.");
onlyIf(task -> !getArchive().get().getAsFile().exists()); onlyIf(_task -> !getArchive().get().getAsFile().exists());
} }
@TaskAction @TaskAction
public final void downloadGraal() throws IOException { public final void downloadGraal() throws IOException {
Path cache = getCacheSubdirectory().get(); Files.createDirectories(getArchive().get().getAsFile().toPath().getParent());
Files.createDirectories(cache);
final String artifactPattern = final String artifactPattern =
isGraalRcVersion() ? ARTIFACT_PATTERN_RC_VERSION : ARTIFACT_PATTERN_RELEASE_VERSION; isGraalRcVersion() ? ARTIFACT_PATTERN_RC_VERSION : ARTIFACT_PATTERN_RELEASE_VERSION;
@ -67,7 +67,8 @@ public class DownloadGraalTask extends DefaultTask {
@OutputFile @OutputFile
public final Provider<RegularFile> getArchive() { public final Provider<RegularFile> getArchive() {
return getProject().getLayout().file(getCacheSubdirectory().map(dir -> dir.resolve(render(FILENAME_PATTERN)) return getProject().getLayout().file(getCacheSubdirectory().map(dir -> dir.resolve(javaVersion.get())
.resolve(render(FILENAME_PATTERN))
.toFile())); .toFile()));
} }
@ -80,6 +81,15 @@ public class DownloadGraalTask extends DefaultTask {
graalVersion.set(provider); graalVersion.set(provider);
} }
@Input
public final Provider<String> getJavaVersion() {
return javaVersion;
}
public final void setJavaVersion(Provider<String> provider) {
javaVersion.set(provider);
}
@Input @Input
public final Provider<String> getDownloadBaseUrl() { public final Provider<String> getDownloadBaseUrl() {
return downloadBaseUrl; return downloadBaseUrl;
@ -94,11 +104,16 @@ public class DownloadGraalTask extends DefaultTask {
} }
private String render(String pattern) { private String render(String pattern) {
final String computedJavaVersion = GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 19, 3)
? "java" + javaVersion.get()
: ""; // for GraalVM >= 19.3 the naming contains java8 or java11
return pattern.replaceAll("\\[url\\]", downloadBaseUrl.get()) return pattern.replaceAll("\\[url\\]", downloadBaseUrl.get())
.replaceAll("\\[version\\]", graalVersion.get()) .replaceAll("\\[version\\]", graalVersion.get())
.replaceAll("\\[javaVersion\\]", computedJavaVersion)
.replaceAll("\\[os\\]", getOperatingSystem()) .replaceAll("\\[os\\]", getOperatingSystem())
.replaceAll("\\[arch\\]", getArchitecture()) .replaceAll("\\[arch\\]", getArchitecture())
.replaceAll("\\[ext\\]", getArchiveExtension()); .replaceAll("\\[ext\\]", getArchiveExtension())
.replaceAll("--", "-"); // for GraalVM < 19.3 there's only a Java8 package
} }
private String getOperatingSystem() { private String getOperatingSystem() {

View file

@ -41,25 +41,29 @@ public class ExtractGraalTask extends DefaultTask {
* These binaries get .cmd as their filename extension, instead of .cmd (on Windows). * These binaries get .cmd as their filename extension, instead of .cmd (on Windows).
*/ */
private static final Set<String> WINDOWS_CMD_BINARIES = private static final Set<String> WINDOWS_CMD_BINARIES =
new HashSet<>(Arrays.asList("native-image", "native-image-configure", "polyglot")); new HashSet<>(Arrays.asList("native-image", "native-image-configure", "polyglot", "gu"));
private final RegularFileProperty inputArchive = getProject().getObjects().fileProperty(); private final RegularFileProperty inputArchive = getProject().getObjects().fileProperty();
private final Property<String> graalVersion = getProject().getObjects().property(String.class); private final Property<String> graalVersion = getProject().getObjects().property(String.class);
private final Property<String> javaVersion = getProject().getObjects().property(String.class);
private final DirectoryProperty outputDirectory = getProject().getObjects().directoryProperty(); private final DirectoryProperty outputDirectory = getProject().getObjects().directoryProperty();
private final Property<Path> cacheDir = getProject().getObjects().property(Path.class); private final Property<Path> cacheDir = getProject().getObjects().property(Path.class);
private final Property<String> graalDirectoryName =
getProject().getObjects().property(String.class);
public ExtractGraalTask() { public ExtractGraalTask() {
setGroup(GradleGraalPlugin.TASK_GROUP); setGroup(GradleGraalPlugin.TASK_GROUP);
setDescription("Extracts GraalVM tooling from downloaded archive using the system's tar command or Gradle's" setDescription("Extracts GraalVM tooling from downloaded archive using the system's tar command or Gradle's"
+ " copy method."); + " copy method.");
onlyIf(task -> !getOutputDirectory().get().getAsFile().exists()); onlyIf(_task -> !getOutputDirectory().get().getAsFile().exists());
outputDirectory.set(graalVersion.map(v -> getProject() outputDirectory.set(cacheDir.map(_cd -> getProject()
.getLayout() .getLayout()
.getProjectDirectory() .getProjectDirectory()
.dir(cacheDir.get().toFile().getAbsolutePath()) .dir(cacheDir.get().toFile().getAbsolutePath())
.dir(v) .dir(graalVersion.get())
.dir("graalvm-ce-" + v))); .dir(javaVersion.get())
.dir(graalDirectoryName.get())));
} }
@TaskAction @TaskAction
@ -70,7 +74,7 @@ public class ExtractGraalTask extends DefaultTask {
Project project = getProject(); Project project = getProject();
File inputArchiveFile = inputArchive.get().getAsFile(); File inputArchiveFile = inputArchive.get().getAsFile();
Path versionedCacheDir = cacheDir.get().resolve(graalVersion.get()); Path versionedCacheDir = cacheDir.get().resolve(Paths.get(graalVersion.get(), javaVersion.get()));
if (inputArchiveFile.getName().endsWith(".zip")) { if (inputArchiveFile.getName().endsWith(".zip")) {
project.copy(copySpec -> { project.copy(copySpec -> {
@ -113,7 +117,7 @@ public class ExtractGraalTask extends DefaultTask {
} }
return cacheDir.get() return cacheDir.get()
.resolve(Paths.get(graalVersion.get(), "graalvm-ce-" + graalVersion.get())) .resolve(Paths.get(graalVersion.get(), javaVersion.get(), graalDirectoryName.get()))
.resolve(getArchitectureSpecifiedBinaryPath(binaryName + binaryExtension)) .resolve(getArchitectureSpecifiedBinaryPath(binaryName + binaryExtension))
.toFile(); .toFile();
} }
@ -148,6 +152,15 @@ public class ExtractGraalTask extends DefaultTask {
graalVersion.set(provider); graalVersion.set(provider);
} }
@Input
public final Provider<String> getJavaVersion() {
return javaVersion;
}
public final void setJavaVersion(Provider<String> provider) {
javaVersion.set(provider);
}
@OutputDirectory @OutputDirectory
public final Provider<Directory> getOutputDirectory() { public final Provider<Directory> getOutputDirectory() {
return outputDirectory; return outputDirectory;
@ -156,4 +169,8 @@ public class ExtractGraalTask extends DefaultTask {
final void setCacheDir(Path value) { final void setCacheDir(Path value) {
cacheDir.set(value); cacheDir.set(value);
} }
final void setGraalDirectoryName(Provider<String> value) {
graalDirectoryName.set(value);
}
} }

View file

@ -0,0 +1,44 @@
/*
* (c) Copyright 2018 Palantir Technologies Inc. All rights reserved.
*
* 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
*
* http://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.
*/
package com.palantir.gradle.graal;
import java.io.File;
import java.util.AbstractSet;
import java.util.HashSet;
import java.util.List;
public final class FileUtil {
public static String getFirstFromDirectory(File directory, List<String> searchList) {
if (!directory.exists()) {
return null;
}
AbstractSet<String> subDirectoriesNames = new HashSet<String>();
File[] subDirectories = directory.listFiles(File::isDirectory);
for (File subDirectory : subDirectories) {
subDirectoriesNames.add(subDirectory.getName());
}
for (String stringToSearch : searchList) {
if (subDirectoriesNames.contains(stringToSearch)) {
return stringToSearch;
}
}
return null;
}
private FileUtil() {}
}

View file

@ -16,35 +16,64 @@
package com.palantir.gradle.graal; package com.palantir.gradle.graal;
import java.io.File;
import java.util.Arrays;
import java.util.List; import java.util.List;
import org.gradle.api.GradleException; import org.gradle.api.GradleException;
import org.gradle.api.Project; import org.gradle.api.Project;
import org.gradle.api.provider.ListProperty; import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Property; import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider; import org.gradle.api.provider.Provider;
import org.gradle.api.provider.ProviderFactory;
/** Contains options and settings for tuning GraalVM use. */ /**
* Contains options and settings for tuning GraalVM use.
*/
public class GraalExtension { public class GraalExtension {
private static final String WINDOWS_7_ENV_PATH =
"C:\\Program Files\\Microsoft SDKs\\" + "Windows\\v7.1\\Bin\\SetEnv.cmd";
private static final List<String> SUPPORTED_WINDOWS_VS_VERSIONS = Arrays.asList("2019", "2017");
private static final List<String> SUPPORTED_WINDOWS_VS_EDITIONS =
Arrays.asList("Enterprise", "Professional", "Community");
private static final String DEFAULT_WINDOWS_VS_PATH = "C:\\Program Files (x86)\\" + "Microsoft Visual Studio";
private static final String DEFAULT_WINDOWS_VS_VARS_PATH = "C:\\Program Files (x86)\\Microsoft Visual Studio\\"
+ "{version}\\{edition}\\VC\\Auxiliary\\"
+ "Build\\vcvars64.bat";
private static final String DEFAULT_DOWNLOAD_BASE_URL = "https://github.com/oracle/graal/releases/download/"; private static final String DEFAULT_DOWNLOAD_BASE_URL = "https://github.com/oracle/graal/releases/download/";
private static final String DEFAULT_GRAAL_VERSION = "19.2.0"; private static final String DOWNLOAD_BASE_URL_GRAAL_19_3 =
"https://github.com/graalvm/graalvm-ce-builds/" + "releases/download/";
private static final String DEFAULT_GRAAL_VERSION = "20.2.0";
private static final List<String> SUPPORTED_JAVA_VERSIONS = Arrays.asList("17", "16", "11", "8");
private static final String DEFAULT_JAVA_VERSION = "8";
private final Property<String> downloadBaseUrl; private final Property<String> downloadBaseUrl;
private final Property<String> graalVersion; private final Property<String> graalVersion;
private final Property<String> javaVersion;
private final Property<String> windowsVsVarsPath;
private final Property<String> windowsVsVersion;
private final Property<String> windowsVsEdition;
private final Property<String> mainClass; private final Property<String> mainClass;
private final Property<String> outputName; private final Property<String> outputName;
private final ListProperty<String> options; private final ListProperty<String> options;
private ProviderFactory providerFactory;
public GraalExtension(Project project) { public GraalExtension(Project project) {
downloadBaseUrl = project.getObjects().property(String.class); downloadBaseUrl = project.getObjects().property(String.class);
graalVersion = project.getObjects().property(String.class); graalVersion = project.getObjects().property(String.class);
javaVersion = project.getObjects().property(String.class);
windowsVsVarsPath = project.getObjects().property(String.class);
windowsVsVersion = project.getObjects().property(String.class);
windowsVsEdition = project.getObjects().property(String.class);
mainClass = project.getObjects().property(String.class); mainClass = project.getObjects().property(String.class);
outputName = project.getObjects().property(String.class); outputName = project.getObjects().property(String.class);
options = project.getObjects().listProperty(String.class).empty(); // .empty() required to initialize options = project.getObjects().listProperty(String.class).empty(); // .empty() required to initialize
providerFactory = project.getProviders();
// defaults // defaults
downloadBaseUrl.set(DEFAULT_DOWNLOAD_BASE_URL);
graalVersion.set(DEFAULT_GRAAL_VERSION); graalVersion.set(DEFAULT_GRAAL_VERSION);
javaVersion.set(DEFAULT_JAVA_VERSION);
} }
public final void downloadBaseUrl(String value) { public final void downloadBaseUrl(String value) {
@ -54,17 +83,20 @@ public class GraalExtension {
/** /**
* Returns the base URL to use for downloading GraalVM binaries. * Returns the base URL to use for downloading GraalVM binaries.
* *
* <p>Defaults to {@link #DEFAULT_DOWNLOAD_BASE_URL}.</p> * <p>Defaults to {@link #DEFAULT_DOWNLOAD_BASE_URL} for GraalVM lower than 19.3.</p>
* <p>Defaults to {@link #DOWNLOAD_BASE_URL_GRAAL_19_3} for GraalVM higher or equal to 19.3.</p>
*/ */
public final Provider<String> getDownloadBaseUrl() { public final Provider<String> getDownloadBaseUrl() {
return downloadBaseUrl; return downloadBaseUrl.orElse(getDefaultDownloadBaseUrl());
} }
public final void mainClass(String value) { public final void mainClass(String value) {
mainClass.set(value); mainClass.set(value);
} }
/** Returns the main class to use as the entry point to the generated executable file. */ /**
* Returns the main class to use as the entry point to the generated executable file.
*/
public final Provider<String> getMainClass() { public final Provider<String> getMainClass() {
return mainClass; return mainClass;
} }
@ -86,6 +118,78 @@ public class GraalExtension {
graalVersion.set(value); graalVersion.set(value);
} }
/**
* Returns the javaVersion for GraalVM to use.
*
* <p>Defaults to {@link #DEFAULT_JAVA_VERSION}</p>
*/
public final Provider<String> getJavaVersion() {
return javaVersion;
}
public final void javaVersion(String value) {
if (!SUPPORTED_JAVA_VERSIONS.contains(value)) {
throw new GradleException(
"Java version " + value + " is not supported. Supported versions are: " + SUPPORTED_JAVA_VERSIONS);
}
javaVersion.set(value);
}
/**
* Returns the VS 64-bit Variables Path to use.
*
* <p>Defaults to {@link #DEFAULT_WINDOWS_VS_VARS_PATH} for JDK higher or equal to 11</p>
* <p>Defaults to {@link #WINDOWS_7_ENV_PATH} for JDK lower than 11</p>
*/
public final Provider<String> getWindowsVsVarsPath() {
return windowsVsVarsPath.orElse(searchWindowsVsVarsPath());
}
private String searchWindowsVsVarsPath() {
String searchedVsVersion = windowsVsVersion.getOrElse(getNewestWindowsVsVersionInstalled());
String searchedVsEdition = windowsVsEdition.getOrElse(getBiggestWindowsVsEditionInstalled(searchedVsVersion));
if (searchedVsEdition == null || searchedVsVersion == null) {
return "";
}
String searchedVsVarsPath = Integer.parseInt(javaVersion.get()) >= 11
? DEFAULT_WINDOWS_VS_VARS_PATH
.replaceAll("\\{version}", searchedVsVersion)
.replaceAll("\\{edition}", searchedVsEdition)
: WINDOWS_7_ENV_PATH;
if (WINDOWS_7_ENV_PATH.equals(searchedVsVarsPath)) {
if (!new File(WINDOWS_7_ENV_PATH).exists()) {
return "";
}
}
return searchedVsVarsPath;
}
private String getNewestWindowsVsVersionInstalled() {
return FileUtil.getFirstFromDirectory(new File(DEFAULT_WINDOWS_VS_PATH), SUPPORTED_WINDOWS_VS_VERSIONS);
}
private String getBiggestWindowsVsEditionInstalled(String version) {
if (version == null) {
return null;
}
return FileUtil.getFirstFromDirectory(
new File(DEFAULT_WINDOWS_VS_PATH, version), SUPPORTED_WINDOWS_VS_EDITIONS);
}
public final void windowsVsVarsPath(String value) {
windowsVsVarsPath.set(value);
}
public final void windowsVsVersion(String value) {
windowsVsVersion.set(value);
}
public final void windowsVsEdition(String value) {
windowsVsEdition.set(value);
}
/** /**
* Returns the graalVersion of GraalVM to use. * Returns the graalVersion of GraalVM to use.
* *
@ -96,7 +200,7 @@ public class GraalExtension {
} }
public final Provider<List<String>> getOptions() { public final Provider<List<String>> getOptions() {
return this.options; return options;
} }
/** /**
@ -108,4 +212,30 @@ public class GraalExtension {
} }
this.options.add(option); this.options.add(option);
} }
public final Provider<String> getGraalDirectoryName() {
return providerFactory.provider(() -> {
if (GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 19, 3)) {
return "graalvm-ce-java" + javaVersion.get() + "-" + graalVersion.get();
}
return "graalvm-ce-" + graalVersion.get();
});
}
private String getDefaultDownloadBaseUrl() {
if (javaVersion.get().equals("17")
&& !GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 21, 3)) {
throw new GradleException(
"Unsupported GraalVM version " + graalVersion.get() + " for Java 17, needs >= 21.3.0.");
} else if (javaVersion.get().equals("16")
&& !GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 21, 1)) {
throw new GradleException(
"Unsupported GraalVM version " + graalVersion.get() + " for Java 16, needs >= 21.1.0.");
} else if (GraalVersionUtil.isGraalVersionGreaterOrEqualThan(graalVersion.get(), 19, 3)) {
return DOWNLOAD_BASE_URL_GRAAL_19_3;
} else if (!javaVersion.get().equals("8")) {
throw new GradleException("Unsupported Java version for GraalVM version.");
}
return DEFAULT_DOWNLOAD_BASE_URL;
}
} }

View file

@ -0,0 +1,32 @@
/*
* (c) Copyright 2018 Palantir Technologies Inc. All rights reserved.
*
* 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
*
* http://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.
*/
package com.palantir.gradle.graal;
public final class GraalVersionUtil {
public static boolean isGraalVersionGreaterOrEqualThan(String graalVersion, int majorVersion, int minorVersion) {
try {
final String[] versionSplit = graalVersion.split("\\.", -1);
final int majorVersion0 = Integer.valueOf(versionSplit[0]);
final int minorVersion0 = Integer.valueOf(versionSplit[1]);
return majorVersion0 > majorVersion || (majorVersion0 == majorVersion && minorVersion0 >= minorVersion);
} catch (NumberFormatException ignored) {
return false;
}
}
private GraalVersionUtil() {}
}

View file

@ -62,6 +62,7 @@ public class GradleGraalPlugin implements Plugin<Project> {
TaskProvider<DownloadGraalTask> downloadGraal = project.getTasks() TaskProvider<DownloadGraalTask> downloadGraal = project.getTasks()
.register("downloadGraalTooling", DownloadGraalTask.class, task -> { .register("downloadGraalTooling", DownloadGraalTask.class, task -> {
task.setGraalVersion(extension.getGraalVersion()); task.setGraalVersion(extension.getGraalVersion());
task.setJavaVersion(extension.getJavaVersion());
task.setDownloadBaseUrl(extension.getDownloadBaseUrl()); task.setDownloadBaseUrl(extension.getDownloadBaseUrl());
task.setCacheDir(cacheDir); task.setCacheDir(cacheDir);
}); });
@ -69,8 +70,10 @@ public class GradleGraalPlugin implements Plugin<Project> {
TaskProvider<ExtractGraalTask> extractGraal = project.getTasks() TaskProvider<ExtractGraalTask> extractGraal = project.getTasks()
.register("extractGraalTooling", ExtractGraalTask.class, task -> { .register("extractGraalTooling", ExtractGraalTask.class, task -> {
task.setGraalVersion(extension.getGraalVersion()); task.setGraalVersion(extension.getGraalVersion());
task.setJavaVersion(extension.getJavaVersion());
task.setInputArchive(downloadGraal.get().getArchive()); task.setInputArchive(downloadGraal.get().getArchive());
task.setCacheDir(cacheDir); task.setCacheDir(cacheDir);
task.setGraalDirectoryName(extension.getGraalDirectoryName());
task.dependsOn(downloadGraal); task.dependsOn(downloadGraal);
}); });
@ -79,9 +82,12 @@ public class GradleGraalPlugin implements Plugin<Project> {
task.setMainClass(extension.getMainClass()); task.setMainClass(extension.getMainClass());
task.setOutputName(extension.getOutputName()); task.setOutputName(extension.getOutputName());
task.setGraalVersion(extension.getGraalVersion()); task.setGraalVersion(extension.getGraalVersion());
task.setJavaVersion(extension.getJavaVersion());
task.setWindowsVsVarsPath(extension.getWindowsVsVarsPath());
task.setJarFile(jar.map(j -> j.getOutputs().getFiles().getSingleFile())); task.setJarFile(jar.map(j -> j.getOutputs().getFiles().getSingleFile()));
task.setClasspath(project.getConfigurations().named("runtimeClasspath")); task.setClasspath(project.getConfigurations().named("runtimeClasspath"));
task.setCacheDir(cacheDir); task.setCacheDir(cacheDir);
task.setGraalDirectoryName(extension.getGraalDirectoryName());
task.setOptions(extension.getOptions()); task.setOptions(extension.getOptions());
task.dependsOn(extractGraal); task.dependsOn(extractGraal);
task.dependsOn(jar); task.dependsOn(jar);
@ -91,9 +97,12 @@ public class GradleGraalPlugin implements Plugin<Project> {
project.getTasks().register("sharedLibrary", SharedLibraryTask.class, task -> { project.getTasks().register("sharedLibrary", SharedLibraryTask.class, task -> {
task.setOutputName(extension.getOutputName()); task.setOutputName(extension.getOutputName());
task.setGraalVersion(extension.getGraalVersion()); task.setGraalVersion(extension.getGraalVersion());
task.setJavaVersion(extension.getJavaVersion());
task.setWindowsVsVarsPath(extension.getWindowsVsVarsPath());
task.setJarFile(sharedLibrary.map(j -> j.getOutputs().getFiles().getSingleFile())); task.setJarFile(sharedLibrary.map(j -> j.getOutputs().getFiles().getSingleFile()));
task.setClasspath(project.getConfigurations().named("runtimeClasspath")); task.setClasspath(project.getConfigurations().named("runtimeClasspath"));
task.setCacheDir(cacheDir); task.setCacheDir(cacheDir);
task.setGraalDirectoryName(extension.getGraalDirectoryName());
task.setOptions(extension.getOptions()); task.setOptions(extension.getOptions());
task.dependsOn(extractGraal); task.dependsOn(extractGraal);
task.dependsOn(sharedLibrary); task.dependsOn(sharedLibrary);

View file

@ -1 +0,0 @@
implementation-class=com.palantir.gradle.graal.GradleGraalPlugin

View file

@ -0,0 +1,161 @@
/*
* (c) Copyright 2018 Palantir Technologies Inc. All rights reserved.
*
* 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
*
* http://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.
*/
package com.palantir.gradle.graal
import com.palantir.gradle.graal.util.JavaVersionUtil
import nebula.test.ProjectSpec
import org.gradle.api.GradleException
import spock.lang.Requires
class GradleExtensionSpec extends ProjectSpec {
GraalExtension extension
def setup() {
extension = new GraalExtension(project)
}
def 'extension returns the correct Graal download URL and directory name for default Java version and graalVersion 19.2.0'() {
when:
extension.graalVersion("19.2.0")
then:
extension.getDownloadBaseUrl().get() =~ "https://github.com/oracle/graal/releases/download/"
extension.getGraalDirectoryName().get() =~ "graalvm-ce-19.2.0"
}
def 'extension returns the correct Graal download URL and directory name for default Java version and graalVersion 19.3.0'() {
when:
extension.graalVersion("19.3.0")
then:
extension.getDownloadBaseUrl().get() =~ "https://github.com/graalvm/graalvm-ce-builds/releases/download/"
extension.getGraalDirectoryName().get() =~ "graalvm-ce-java8-19.3.0"
}
def 'extension returns the correct Graal download URL and directory name for Java version 8 and graalVersion 19.2.0'() {
when:
extension.javaVersion("8")
extension.graalVersion("19.2.0")
then:
extension.getDownloadBaseUrl().get() =~ "https://github.com/oracle/graal/releases/download/"
extension.getGraalDirectoryName().get() =~ "graalvm-ce-19.2.0"
}
def 'extension returns the correct Graal download URL and directory name for Java version 8 and graalVersion 19.3.0'() {
when:
extension.javaVersion("8")
extension.graalVersion("19.3.0")
then:
extension.getDownloadBaseUrl().get() =~ "https://github.com/graalvm/graalvm-ce-builds/releases/download/"
extension.getGraalDirectoryName().get() =~ "graalvm-ce-java8-19.3.0"
}
def 'extension should throw exception for graalVersion 19.2.0 and Java version 11'() {
when:
extension.javaVersion("11")
extension.graalVersion("19.2.0")
extension.getDownloadBaseUrl().get()
then:
thrown GradleException
}
def 'extension returns the correct Graal download URL and directory name for Java version 11 and graalVersion 19.3.0'() {
when:
extension.javaVersion("11")
extension.graalVersion("19.3.0")
then:
extension.getDownloadBaseUrl().get() =~ "https://github.com/graalvm/graalvm-ce-builds/releases/download/"
extension.getGraalDirectoryName().get() =~ "graalvm-ce-java11-19.3.0"
}
def 'extension should throw exception for graalVersion 21.0.0 and Java version 16'() {
when:
extension.javaVersion("16")
extension.graalVersion("21.0.0")
extension.getDownloadBaseUrl().get()
then:
thrown GradleException
}
def 'extension returns the correct Graal download URL and directory name for Java version 16 and graalVersion 21.1.0'() {
when:
extension.javaVersion("16")
extension.graalVersion("21.1.0")
then:
extension.getDownloadBaseUrl().get() =~ "https://github.com/graalvm/graalvm-ce-builds/releases/download/"
extension.getGraalDirectoryName().get() =~ "graalvm-ce-java16-21.1.0"
}
def 'extension should throw exception for graalVersion 21.1.0 and Java version 17'() {
when:
extension.javaVersion("17")
extension.graalVersion("21.1.0")
extension.getDownloadBaseUrl().get()
then:
thrown GradleException
}
def 'extension returns the correct Graal download URL and directory name for Java version 17 and graalVersion 21.3.0'() {
when:
extension.javaVersion("17")
extension.graalVersion("21.3.0")
then:
extension.getDownloadBaseUrl().get() =~ "https://github.com/graalvm/graalvm-ce-builds/releases/download/"
extension.getGraalDirectoryName().get() =~ "graalvm-ce-java17-21.3.0"
}
def 'extension should throw exception for unsupported Java version'() {
when:
extension.javaVersion("12")
then:
thrown GradleException
}
@Requires({ Platform.operatingSystem() == Platform.OperatingSystem.WINDOWS && JavaVersionUtil.runtimeMajorVersion() == 8 })
def 'extension returns the correct Windows VS Vars Path for default Java version 8'() {
expect:
extension.getWindowsVsVarsPath().get() == "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Bin\\SetEnv.cmd"
}
@Requires({ Platform.operatingSystem() == Platform.OperatingSystem.WINDOWS && JavaVersionUtil.runtimeMajorVersion() == 11 })
def 'extension returns the correct Windows VS Vars Path for Java version 11 and set Windows VS Version and Edition'() {
when:
extension.javaVersion("11")
extension.windowsVsVersion("2019")
extension.windowsVsEdition("Enterprise")
then:
extension.getWindowsVsVarsPath().get() == "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"
}
def 'extension returns the provided Windows VS Vars Path'() {
when:
extension.windowsVsVarsPath("path")
then:
extension.getWindowsVsVarsPath().get() =~ "path"
}
}

View file

@ -16,9 +16,11 @@
package com.palantir.gradle.graal package com.palantir.gradle.graal
import com.palantir.gradle.graal.util.JavaVersionUtil
import nebula.test.IntegrationSpec import nebula.test.IntegrationSpec
import nebula.test.functional.ExecutionResult import nebula.test.functional.ExecutionResult
import spock.lang.IgnoreIf import spock.lang.IgnoreIf
import spock.lang.Requires
import static com.palantir.gradle.graal.Platform.OperatingSystem.LINUX import static com.palantir.gradle.graal.Platform.OperatingSystem.LINUX
import static com.palantir.gradle.graal.Platform.OperatingSystem.MAC import static com.palantir.gradle.graal.Platform.OperatingSystem.MAC
@ -26,6 +28,7 @@ import static com.palantir.gradle.graal.Platform.OperatingSystem.WINDOWS
class GradleGraalEndToEndSpec extends IntegrationSpec { class GradleGraalEndToEndSpec extends IntegrationSpec {
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
def 'test default version nativeImage'() { def 'test default version nativeImage'() {
setup: setup:
directory("src/main/java/com/palantir/test") directory("src/main/java/com/palantir/test")
@ -86,7 +89,195 @@ class GradleGraalEndToEndSpec extends IntegrationSpec {
output.getAbsolutePath().execute().text.equals("hello, world (modified)!" + System.lineSeparator()) output.getAbsolutePath().execute().text.equals("hello, world (modified)!" + System.lineSeparator())
} }
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
def 'test version 19.3.0 nativeImage'() {
setup:
directory("src/main/java/com/palantir/test")
file("src/main/java/com/palantir/test/Main.java") << '''
package com.palantir.test;
public final class Main {
public static final void main(String[] args) {
System.out.println("hello, world!");
}
}
'''
buildFile << '''
apply plugin: 'com.palantir.graal'
graal {
mainClass 'com.palantir.test.Main'
outputName 'hello-world'
graalVersion '19.3.0'
}
'''
when:
ExecutionResult result = runTasksSuccessfully('nativeImage') // note, this accesses your real ~/.gradle cache
println "Gradle Standard Out:\n" + result.standardOutput
println "Gradle Standard Error:\n" + result.standardError
def outputPath = "build/graal/hello-world"
if (Platform.operatingSystem() == WINDOWS) {
outputPath += ".exe"
}
File output = new File(getProjectDir(), outputPath)
then:
output.exists()
output.getAbsolutePath().execute().text.equals("hello, world!" + System.lineSeparator())
when:
ExecutionResult result2 = runTasksSuccessfully('nativeImage')
then:
result2.wasUpToDate(':nativeImage')
when:
new File(getProjectDir(), "src/main/java/com/palantir/test/Main.java").text = '''
package com.palantir.test;
public final class Main {
public static final void main(String[] args) {
System.out.println("hello, world (modified)!");
}
}
'''
ExecutionResult result3 = runTasksSuccessfully('nativeImage')
then:
println result3.standardOutput
!result3.wasUpToDate(':nativeImage')
output.getAbsolutePath().execute().text.equals("hello, world (modified)!" + System.lineSeparator())
}
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
def 'test version 20.1.0 nativeImage'() {
setup:
directory("src/main/java/com/palantir/test")
file("src/main/java/com/palantir/test/Main.java") << '''
package com.palantir.test;
public final class Main {
public static final void main(String[] args) {
System.out.println("hello, world!");
}
}
'''
buildFile << '''
apply plugin: 'com.palantir.graal'
graal {
mainClass 'com.palantir.test.Main'
outputName 'hello-world'
graalVersion '20.1.0'
}
'''
when:
ExecutionResult result = runTasksSuccessfully('nativeImage') // note, this accesses your real ~/.gradle cache
println "Gradle Standard Out:\n" + result.standardOutput
println "Gradle Standard Error:\n" + result.standardError
def outputPath = "build/graal/hello-world"
if (Platform.operatingSystem() == WINDOWS) {
outputPath += ".exe"
}
File output = new File(getProjectDir(), outputPath)
then:
output.exists()
output.getAbsolutePath().execute().text.equals("hello, world!" + System.lineSeparator())
when:
ExecutionResult result2 = runTasksSuccessfully('nativeImage')
then:
result2.wasUpToDate(':nativeImage')
when:
new File(getProjectDir(), "src/main/java/com/palantir/test/Main.java").text = '''
package com.palantir.test;
public final class Main {
public static final void main(String[] args) {
System.out.println("hello, world (modified)!");
}
}
'''
ExecutionResult result3 = runTasksSuccessfully('nativeImage')
then:
println result3.standardOutput
!result3.wasUpToDate(':nativeImage')
output.getAbsolutePath().execute().text.equals("hello, world (modified)!" + System.lineSeparator())
}
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 11 })
def 'test version 19.3.0 nativeImage Java 11'() {
setup:
directory("src/main/java/com/palantir/test")
file("src/main/java/com/palantir/test/Main.java") << '''
package com.palantir.test;
public final class Main {
public static final void main(String[] args) {
System.out.println("hello, world!");
}
}
'''
buildFile << '''
apply plugin: 'com.palantir.graal'
graal {
mainClass 'com.palantir.test.Main'
outputName 'hello-world'
graalVersion '19.3.0'
javaVersion '11'
}
'''
when:
ExecutionResult result = runTasksSuccessfully('nativeImage') // note, this accesses your real ~/.gradle cache
println "Gradle Standard Out:\n" + result.standardOutput
println "Gradle Standard Error:\n" + result.standardError
def outputPath = "build/graal/hello-world"
if (Platform.operatingSystem() == WINDOWS) {
outputPath += ".exe"
}
File output = new File(getProjectDir(), outputPath)
then:
output.exists()
output.getAbsolutePath().execute().text.equals("hello, world!" + System.lineSeparator())
when:
ExecutionResult result2 = runTasksSuccessfully('nativeImage')
then:
result2.wasUpToDate(':nativeImage')
when:
new File(getProjectDir(), "src/main/java/com/palantir/test/Main.java").text = '''
package com.palantir.test;
public final class Main {
public static final void main(String[] args) {
System.out.println("hello, world (modified)!");
}
}
'''
ExecutionResult result3 = runTasksSuccessfully('nativeImage')
then:
println result3.standardOutput
!result3.wasUpToDate(':nativeImage')
output.getAbsolutePath().execute().text.equals("hello, world (modified)!" + System.lineSeparator())
}
// there is no RC version for Windows // there is no RC version for Windows
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
@IgnoreIf({ Platform.operatingSystem() == WINDOWS }) @IgnoreIf({ Platform.operatingSystem() == WINDOWS })
def 'test 1.0.0-rc5 nativeImage'() { def 'test 1.0.0-rc5 nativeImage'() {
setup: setup:
@ -149,7 +340,8 @@ class GradleGraalEndToEndSpec extends IntegrationSpec {
output.getAbsolutePath().execute().text.equals("hello, world (modified)!" + System.lineSeparator()) output.getAbsolutePath().execute().text.equals("hello, world (modified)!" + System.lineSeparator())
} }
def 'allows specifying additional properties'() { @Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
def 'allows specifying additional properties on default version'() {
setup: setup:
directory("src/main/java/com/palantir/test") directory("src/main/java/com/palantir/test")
file("src/main/java/com/palantir/test/Main.java") << ''' file("src/main/java/com/palantir/test/Main.java") << '''
@ -198,6 +390,7 @@ class GradleGraalEndToEndSpec extends IntegrationSpec {
output.getAbsolutePath().execute().text.toLowerCase().contains("<html") output.getAbsolutePath().execute().text.toLowerCase().contains("<html")
} }
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
def 'can build shared libraries on default version'() { def 'can build shared libraries on default version'() {
setup: setup:
directory("src/main/java/com/palantir/test") directory("src/main/java/com/palantir/test")
@ -220,7 +413,57 @@ class GradleGraalEndToEndSpec extends IntegrationSpec {
dylibFile.exists() dylibFile.exists()
} }
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
def 'can build shared libraries on version 19.3.0'() {
setup:
directory("src/main/java/com/palantir/test")
file("src/main/java/com/palantir/test/Main.java") << '''
package com.palantir.test;
public final class Main {}
'''
buildFile << '''
apply plugin: 'com.palantir.graal'
graal {
outputName 'hello-world'
graalVersion '19.3.0'
}
'''
when:
runTasksSuccessfully('sharedLibrary')
File dylibFile = new File(getProjectDir(), "build/graal/hello-world." + getSharedLibPrefixByOs())
then:
dylibFile.exists()
}
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 11 })
def 'can build shared libraries on version 19.3.0 Java 11'() {
setup:
directory("src/main/java/com/palantir/test")
file("src/main/java/com/palantir/test/Main.java") << '''
package com.palantir.test;
public final class Main {}
'''
buildFile << '''
apply plugin: 'com.palantir.graal'
graal {
outputName 'hello-world'
graalVersion '19.3.0'
javaVersion '11'
}
'''
when:
runTasksSuccessfully('sharedLibrary')
File dylibFile = new File(getProjectDir(), "build/graal/hello-world." + getSharedLibPrefixByOs())
then:
dylibFile.exists()
}
// there is no RC version for Windows // there is no RC version for Windows
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
@IgnoreIf({ Platform.operatingSystem() == WINDOWS }) @IgnoreIf({ Platform.operatingSystem() == WINDOWS })
def 'can build shared libraries on 1.0.0-rc5'() { def 'can build shared libraries on 1.0.0-rc5'() {
setup: setup:
@ -245,19 +488,7 @@ class GradleGraalEndToEndSpec extends IntegrationSpec {
dylibFile.exists() dylibFile.exists()
} }
def getSharedLibPrefixByOs() { @Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
switch (Platform.operatingSystem()) {
case MAC:
return "dylib"
case LINUX:
return "so"
case WINDOWS:
return "dll"
default:
throw new IllegalStateException("No GraalVM support for " + Platform.operatingSystem())
}
}
def 'should not allow empty mainClass on nativeImage'() { def 'should not allow empty mainClass on nativeImage'() {
buildFile << ''' buildFile << '''
apply plugin: 'com.palantir.graal' apply plugin: 'com.palantir.graal'
@ -278,6 +509,7 @@ class GradleGraalEndToEndSpec extends IntegrationSpec {
result.standardError.contains("No value has been specified for property 'mainClass'") result.standardError.contains("No value has been specified for property 'mainClass'")
} }
@Requires({ JavaVersionUtil.runtimeMajorVersion() == 8 })
def 'should not allow to add -H:Name'() { def 'should not allow to add -H:Name'() {
buildFile << ''' buildFile << '''
apply plugin: 'com.palantir.graal' apply plugin: 'com.palantir.graal'
@ -299,4 +531,18 @@ class GradleGraalEndToEndSpec extends IntegrationSpec {
then: then:
result.standardError.contains("Use 'outputName' instead of") result.standardError.contains("Use 'outputName' instead of")
} }
def getSharedLibPrefixByOs() {
switch (Platform.operatingSystem()) {
case MAC:
return "dylib"
case LINUX:
return "so"
case WINDOWS:
return "dll"
default:
throw new IllegalStateException("No GraalVM support for " + Platform.operatingSystem())
}
}
} }

View file

@ -75,7 +75,7 @@ class GradleGraalPluginIntegrationSpec extends IntegrationSpec {
server.takeRequest().requestUrl.toString() =~ "http://(localhost|127\\.0\\.0\\.1):${server.port}" + server.takeRequest().requestUrl.toString() =~ "http://(localhost|127\\.0\\.0\\.1):${server.port}" +
"/oracle/graal/releases/download//vm-1.0.0-rc3/graalvm-ce-1.0.0-rc3-(macos|linux)-amd64.tar.gz" "/oracle/graal/releases/download//vm-1.0.0-rc3/graalvm-ce-1.0.0-rc3-(macos|linux)-amd64.tar.gz"
file("cacheDir/1.0.0-rc3/graalvm-ce-1.0.0-rc3-amd64.tar.gz").text == '<<tgz>>' file("cacheDir/1.0.0-rc3/8/graalvm-ce-1.0.0-rc3-amd64.tar.gz").text == '<<tgz>>'
} }
// for Windows the download is a .zip, this is tested below // for Windows the download is a .zip, this is tested below
@ -108,7 +108,7 @@ class GradleGraalPluginIntegrationSpec extends IntegrationSpec {
server.takeRequest().path =~ server.takeRequest().path =~
"/oracle/graal/releases/download//vm-19.0.0/graalvm-ce-(darwin|linux)-amd64-19.0.0.tar.gz" "/oracle/graal/releases/download//vm-19.0.0/graalvm-ce-(darwin|linux)-amd64-19.0.0.tar.gz"
file("cacheDir/19.0.0/graalvm-ce-19.0.0-amd64.tar.gz").text == '<<tgz>>' file("cacheDir/19.0.0/8/graalvm-ce-19.0.0-amd64.tar.gz").text == '<<tgz>>'
} }
@Requires({ Platform.operatingSystem() == Platform.OperatingSystem.WINDOWS }) @Requires({ Platform.operatingSystem() == Platform.OperatingSystem.WINDOWS })
@ -138,9 +138,141 @@ class GradleGraalPluginIntegrationSpec extends IntegrationSpec {
// e.g. Docker Desktop puts "127.0.0.1 kubernetes.docker.internal" in there, which ends up in `requestUrl` // e.g. Docker Desktop puts "127.0.0.1 kubernetes.docker.internal" in there, which ends up in `requestUrl`
// so the comparison is only made for `path` // so the comparison is only made for `path`
server.takeRequest().path =~ server.takeRequest().path =~
"/oracle/graal/releases/download//vm-19.0.0/graalvm-ce-windows-amd64-19.0.0.zip" "/oracle/graal/releases/download//vm-19.0.0/graalvm-ce-windows-amd64-19.0.0.zip"
file("cacheDir/19.0.0/graalvm-ce-19.0.0-amd64.zip").text == '<<zip>>' file("cacheDir/19.0.0/8/graalvm-ce-19.0.0-amd64.zip").text == '<<zip>>'
}
// for Windows the download is a .zip, this is tested below
@IgnoreIf({ Platform.operatingSystem() == Platform.OperatingSystem.WINDOWS })
def 'allows specifying GA graal version Java 8 19.3+ (non-windows)'() {
setup:
buildFile << """
apply plugin: 'com.palantir.graal'
graal {
graalVersion '19.3.0'
downloadBaseUrl '${fakeBaseUrl}'
}
"""
server.enqueue(new MockResponse().setBody('<<tgz>>'))
when:
ExecutionResult result = runTasksSuccessfully('downloadGraalTooling')
then:
println result.getStandardOutput()
result.wasExecuted(':downloadGraalTooling')
!result.wasUpToDate(':downloadGraalTooling')
!result.wasSkipped(':downloadGraalTooling')
// `requestUrl` can contain "127.0.0.1" instead of "localhost"
// worse yet, it can contain any hostname that is defined for 127.0.0.1 in the hosts file
// e.g. Docker Desktop puts "127.0.0.1 kubernetes.docker.internal" in there, which ends up in `requestUrl`
// so the comparison is only made for `path`
server.takeRequest().path =~
"oracle/graal/releases/download//vm-19.3.0/graalvm-ce-java8-(darwin|linux)-amd64-19.3.0.tar.gz"
file("cacheDir/19.3.0/8/graalvm-ce-java8-19.3.0-amd64.tar.gz").text == '<<tgz>>'
}
@Requires({ Platform.operatingSystem() == Platform.OperatingSystem.WINDOWS })
def 'allows specifying GA graal version Java 8 19.3+ (windows)'() {
setup:
buildFile << """
apply plugin: 'com.palantir.graal'
graal {
graalVersion '19.3.0'
downloadBaseUrl '${fakeBaseUrl}'
}
"""
server.enqueue(new MockResponse().setBody('<<zip>>'))
when:
ExecutionResult result = runTasksSuccessfully('downloadGraalTooling')
then:
println result.getStandardOutput()
result.wasExecuted(':downloadGraalTooling')
!result.wasUpToDate(':downloadGraalTooling')
!result.wasSkipped(':downloadGraalTooling')
// `requestUrl` can contain "127.0.0.1" instead of "localhost"
// worse yet, it can contain any hostname that is defined for 127.0.0.1 in the hosts file
// e.g. Docker Desktop puts "127.0.0.1 kubernetes.docker.internal" in there, which ends up in `requestUrl`
// so the comparison is only made for `path`
server.takeRequest().path =~
"oracle/graal/releases/download//vm-19.3.0/graalvm-ce-java8-windows-amd64-19.3.0.zip"
file("cacheDir/19.3.0/8/graalvm-ce-java8-19.3.0-amd64.zip").text == '<<zip>>'
}
// for Windows the download is a .zip, this is tested below
@IgnoreIf({ Platform.operatingSystem() == Platform.OperatingSystem.WINDOWS })
def 'allows specifying GA graal version Java 11 19.3+ (non-windows)'() {
setup:
buildFile << """
apply plugin: 'com.palantir.graal'
graal {
graalVersion '19.3.0'
javaVersion '11'
downloadBaseUrl '${fakeBaseUrl}'
}
"""
server.enqueue(new MockResponse().setBody('<<tgz>>'))
when:
ExecutionResult result = runTasksSuccessfully('downloadGraalTooling')
then:
println result.getStandardOutput()
result.wasExecuted(':downloadGraalTooling')
!result.wasUpToDate(':downloadGraalTooling')
!result.wasSkipped(':downloadGraalTooling')
// `requestUrl` can contain "127.0.0.1" instead of "localhost"
// worse yet, it can contain any hostname that is defined for 127.0.0.1 in the hosts file
// e.g. Docker Desktop puts "127.0.0.1 kubernetes.docker.internal" in there, which ends up in `requestUrl`
// so the comparison is only made for `path`
server.takeRequest().path =~
"oracle/graal/releases/download//vm-19.3.0/graalvm-ce-java11-(darwin|linux)-amd64-19.3.0.tar.gz"
file("cacheDir/19.3.0/11/graalvm-ce-java11-19.3.0-amd64.tar.gz").text == '<<tgz>>'
}
@Requires({ Platform.operatingSystem() == Platform.OperatingSystem.WINDOWS })
def 'allows specifying GA graal version Java 11 19.3+ (windows)'() {
setup:
buildFile << """
apply plugin: 'com.palantir.graal'
graal {
graalVersion '19.3.0'
javaVersion '11'
downloadBaseUrl '${fakeBaseUrl}'
}
"""
server.enqueue(new MockResponse().setBody('<<zip>>'))
when:
ExecutionResult result = runTasksSuccessfully('downloadGraalTooling')
then:
println result.getStandardOutput()
result.wasExecuted(':downloadGraalTooling')
!result.wasUpToDate(':downloadGraalTooling')
!result.wasSkipped(':downloadGraalTooling')
// `requestUrl` can contain "127.0.0.1" instead of "localhost"
// worse yet, it can contain any hostname that is defined for 127.0.0.1 in the hosts file
// e.g. Docker Desktop puts "127.0.0.1 kubernetes.docker.internal" in there, which ends up in `requestUrl`
// so the comparison is only made for `path`
server.takeRequest().path =~
"oracle/graal/releases/download//vm-19.3.0/graalvm-ce-java11-windows-amd64-19.3.0.zip"
file("cacheDir/19.3.0/11/graalvm-ce-java11-19.3.0-amd64.zip").text == '<<zip>>'
} }
def 'downloadGraalTooling behaves incrementally'() { def 'downloadGraalTooling behaves incrementally'() {

View file

@ -0,0 +1,48 @@
/*
* (c) Copyright 2018 Palantir Technologies Inc. All rights reserved.
*
* 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
*
* http://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.
*/
package com.palantir.gradle.graal
import nebula.test.ProjectSpec
import org.gradle.api.GradleException
import spock.lang.Specification
class GradleVersionUtilSpec extends Specification {
def 'should detect Graal version 19.2.0 is not 19.3+'() {
expect:
!GraalVersionUtil.isGraalVersionGreaterOrEqualThan("19.2.0", 19, 3)
}
def 'should detect Graal version 19.3.0 is 19.3+'() {
expect:
GraalVersionUtil.isGraalVersionGreaterOrEqualThan("19.3.0", 19, 3)
}
def 'should detect Graal version empty is not 19.3+'() {
expect:
!GraalVersionUtil.isGraalVersionGreaterOrEqualThan("", 19, 3)
}
def 'should detect Graal version 21.1.0 is 21.1+'() {
expect:
GraalVersionUtil.isGraalVersionGreaterOrEqualThan("21.1.0", 21, 1)
}
def 'should detect Graal version 21.0.0 is not 21.1+'() {
expect:
!GraalVersionUtil.isGraalVersionGreaterOrEqualThan("21.0.0", 21, 1)
}
}

View file

@ -14,23 +14,21 @@
* limitations under the License. * limitations under the License.
*/ */
apply plugin: 'com.jfrog.bintray' package com.palantir.gradle.graal.util;
bintray { public class JavaVersionUtil {
user = System.env.BINTRAY_USERNAME public static int runtimeMajorVersion() {
key = System.env.BINTRAY_PASSWORD String version = System.getProperty("java.version");
publish = true if (version.startsWith("1.")) {
pkg { version = version.substring(2, 3);
repo = 'releases' } else {
name = rootProject.name int dot = version.indexOf(".");
userOrg = 'palantir' if (dot != -1) {
licenses = ['Apache-2.0'] version = version.substring(0, dot);
publications = ['nebula'] }
}
return Integer.parseInt(version);
} }
}
publish.dependsOn bintrayUpload private JavaVersionUtil() {}
bintrayUpload.onlyIf {
versionDetails().isCleanTag
} }

View file

@ -2,20 +2,18 @@
[Test dependencies] [Test dependencies]
cglib:cglib-nodep:3.2.2 (1 constraints: 490ded24) cglib:cglib-nodep:3.2.2 (1 constraints: 490ded24)
com.google.code.findbugs:jsr305:3.0.2 (2 constraints: 1d0fb186) com.netflix.nebula:nebula-test:10.2.0 (1 constraints: 35052d3b)
com.google.errorprone:error_prone_annotations:2.3.4 (2 constraints: 200f3287)
com.google.guava:failureaccess:1.0.1 (1 constraints: 140ae1b4)
com.google.guava:guava:27.0.1-jre (2 constraints: c7135868)
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (1 constraints: bd17c918)
com.google.j2objc:j2objc-annotations:1.1 (1 constraints: b609eba0)
com.netflix.nebula:nebula-test:7.8.6 (1 constraints: 17052c36)
com.squareup.okhttp3:mockwebserver:3.14.1 (1 constraints: 3b05423b) com.squareup.okhttp3:mockwebserver:3.14.1 (1 constraints: 3b05423b)
com.squareup.okhttp3:okhttp:3.14.1 (1 constraints: 680fa37c) com.squareup.okhttp3:okhttp:3.14.1 (1 constraints: 680fa37c)
com.squareup.okio:okio:1.17.2 (1 constraints: 850cc309) com.squareup.okio:okio:1.17.2 (1 constraints: 850cc309)
commons-io:commons-io:2.5 (1 constraints: eb0c8d0a) junit:junit:4.13.2 (2 constraints: 221d6f12)
junit:junit:4.12 (2 constraints: 0c1c0d9c) org.apiguardian:apiguardian-api:1.1.2 (2 constraints: 5523ed36)
org.checkerframework:checker-qual:2.5.3 (2 constraints: 260f6187) org.codehaus.groovy:groovy:3.0.9 (2 constraints: 241bc56d)
org.codehaus.mojo:animal-sniffer-annotations:1.17 (1 constraints: ed09d8aa) org.hamcrest:hamcrest:2.2 (1 constraints: d20cdc04)
org.hamcrest:hamcrest-core:1.3 (1 constraints: cc05fe3f) org.hamcrest:hamcrest-core:1.3 (1 constraints: cc05fe3f)
org.junit.platform:junit-platform-commons:1.8.1 (1 constraints: 6e119ed9)
org.junit.platform:junit-platform-engine:1.8.1 (1 constraints: 360d1a1f)
org.objenesis:objenesis:2.4 (1 constraints: ea0c8c0a) org.objenesis:objenesis:2.4 (1 constraints: ea0c8c0a)
org.spockframework:spock-core:1.3-groovy-2.4 (1 constraints: 7c10f3af) org.opentest4j:opentest4j:1.2.0 (1 constraints: 67118bd9)
org.spockframework:spock-core:2.1-M2-groovy-3.0 (2 constraints: e622905a)
org.spockframework:spock-junit4:2.1-M2-groovy-3.0 (1 constraints: 241154df)

View file

@ -1,8 +1,4 @@
com.google.guava:guava = 27.0.1-jre com.fasterxml.jackson.core:jackson-databind = 2.13.2.1
com.netflix.nebula:nebula-test = 7.8.6 com.google.guava:guava = 31.1-jre
com.netflix.nebula:nebula-test = 10.2.0
com.squareup.okhttp3:* = 3.14.1 com.squareup.okhttp3:* = 3.14.1
# conflict resolution
com.google.code.findbugs:jsr305 = 3.0.2
com.google.errorprone:error_prone_annotations = 2.3.4
org.checkerframework:checker-qual = 2.5.3