mirror of
https://github.com/actions/setup-java.git
synced 2024-11-27 03:59:02 +00:00
Add an error condition for non jdk Microsoft OpenJDK build (#265)
This commit is contained in:
parent
d23aed3c80
commit
f0bb916062
3
dist/setup/index.js
vendored
3
dist/setup/index.js
vendored
@ -13889,6 +13889,9 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
|
|||||||
if (!this.stable) {
|
if (!this.stable) {
|
||||||
throw new Error('Early access versions are not supported');
|
throw new Error('Early access versions are not supported');
|
||||||
}
|
}
|
||||||
|
if (this.packageType !== 'jdk') {
|
||||||
|
throw new Error('Microsoft Build of OpenJDK provides only the `jdk` package type');
|
||||||
|
}
|
||||||
const availableVersionsRaw = yield this.getAvailableVersions();
|
const availableVersionsRaw = yield this.getAvailableVersions();
|
||||||
const opts = this.getPlatformOption();
|
const opts = this.getPlatformOption();
|
||||||
const availableVersions = availableVersionsRaw.map(item => ({
|
const availableVersions = availableVersionsRaw.map(item => ({
|
||||||
|
@ -65,6 +65,17 @@ steps:
|
|||||||
- run: java -cp java HelloWorldApp
|
- run: java -cp java HelloWorldApp
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Microsoft
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: 'microsoft'
|
||||||
|
java-version: '11'
|
||||||
|
- run: java -cp java HelloWorldApp
|
||||||
|
```
|
||||||
|
|
||||||
## Installing custom Java package type
|
## Installing custom Java package type
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
|
@ -45,6 +45,10 @@ export class MicrosoftDistributions extends JavaBase {
|
|||||||
throw new Error('Early access versions are not supported');
|
throw new Error('Early access versions are not supported');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.packageType !== 'jdk') {
|
||||||
|
throw new Error('Microsoft Build of OpenJDK provides only the `jdk` package type');
|
||||||
|
}
|
||||||
|
|
||||||
const availableVersionsRaw = await this.getAvailableVersions();
|
const availableVersionsRaw = await this.getAvailableVersions();
|
||||||
|
|
||||||
const opts = this.getPlatformOption();
|
const opts = this.getPlatformOption();
|
||||||
|
Loading…
Reference in New Issue
Block a user