Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
47 lines (38 loc) · 1.92 KB
/
Copy pathjustfile
File metadata and controls
47 lines (38 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
set quiet
import? '../sdk-codegen/utils.just'
_default:
just --list --unsorted
# ⭐ run format and tests to prepare for CI
[no-exit-message]
prepare: format test
# ⭐ run the whole test suite
[no-exit-message]
test *args:
./gradlew test {{ args }}
# run a single test
test-one modelPath: (test "--tests" modelPath)
# ⭐ format all files
[no-exit-message]
format:
./gradlew spotlessApply
# check, but don't change, the formatting
[no-exit-message]
format-check:
./gradlew spotlessCheck
# called by tooling
[private]
update-version version:
echo "{{ version }}" > VERSION
perl -pi -e 's|badge/maven--central-v[.\d\-\w]+-blue|badge/maven--central-v{{ version }}-blue|' README.md
perl -pi -e 's|https:\/\/repo1\.maven\.org\/maven2\/com\/stripe\/stripe-java\/[.\d\-\w]+\/stripe-java-[.\d\-\w]+.jar|https://repo1.maven.org/maven2/com/stripe/stripe-java/{{ version }}/stripe-java-{{ version }}.jar|' README.md
perl -pi -e 's|Current release version: [.\d\-\w]+|Current release version: {{ version }}|' README.md
perl -pi -e 's|implementation "com\.stripe:stripe-java:[.\d\-\w]+"|implementation "com.stripe:stripe-java:{{ version }}"|' README.md
perl -pi -e 's|<version>[.\d\-\w]+<\/version>|<version>{{ version }}</version>|' README.md
perl -pi -e 's|VERSION_NAME=[.\d\-\w]+|VERSION_NAME={{ version }}|' gradle.properties
perl -pi -e 's|public static final String VERSION = "[.\d\-\w]+";|public static final String VERSION = "{{ version }}";|' src/main/java/com/stripe/Stripe.java
# ⭐ print the API version this SDK pins and the lowest runtime it supports
print-version-info:
#!/usr/bin/env bash
set -euo pipefail
echo "pinned-api-version: $(rg -N --color never -m1 -o '[0-9]{4}-[0-9]{2}-[0-9]{2}[.\w-]*' src/main/java/com/stripe/ApiVersion.java)"
echo "minimum-runtime-version: $(rg -N --color never -o 'sourceCompatibility = JavaVersion.VERSION_(\S+)' --replace '$1' build.gradle | tr '_' '.')"