Skip to content

Commit 803178d

Browse files
committed
initial idea
0 parents  commit 803178d

19 files changed

+906
-0
lines changed

.config/dotnet-tools.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"cake.tool": {
6+
"version": "0.38.5",
7+
"commands": [
8+
"dotnet-cake"
9+
]
10+
}
11+
}
12+
}

.github/renovate.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [ "github>nils-a/renovate-config" ],
4+
"packageRules": [
5+
{
6+
"matchPackageNames": ["cake.tool", "Cake.Core"],
7+
"enabled": false
8+
}
9+
]
10+
}

.github/workflows/build.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
- "feature/**"
9+
- "release/**"
10+
- "hotfix/**"
11+
tags:
12+
- "*"
13+
paths-ignore:
14+
- "README.md"
15+
pull_request:
16+
17+
jobs:
18+
build:
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os: [ windows-2019, ubuntu-18.04, macos-10.15 ]
23+
24+
env:
25+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
26+
GITHUB_PAT: ${{ secrets.GH_TOKEN }}
27+
GPR_PASSWORD: ${{ secrets.GPR_PASSWORD }}
28+
GPR_SOURCE: ${{ secrets.GPR_SOURCE }}
29+
GPR_USER: ${{ secrets.GPR_USER }}
30+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
31+
NUGET_SOURCE: "https://api.nuget.org/v3/index.json"
32+
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
33+
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
34+
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
35+
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
36+
#WYAM_ACCESS_TOKEN: ${{ secrets.WYAM_ACCESS_TOKEN }}
37+
#WYAM_DEPLOY_BRANCH: "gh-pages"
38+
#WYAM_DEPLOY_REMOTE: ${{ github.event.repository.html_url }}
39+
40+
steps:
41+
- name: Checkout the repository
42+
uses: actions/[email protected]
43+
- name: Fetch all tags and branches
44+
run: git fetch --prune --unshallow
45+
- name: Cache Tools
46+
uses: actions/[email protected]
47+
with:
48+
path: tools
49+
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
50+
- name: Build project
51+
uses: cake-build/[email protected]
52+
with:
53+
script-path: recipe.cake
54+
target: CI
55+
verbosity: Diagnostic
56+
cake-version: 0.38.5
57+
cake-bootstrap: true
58+
- name: Upload Issues
59+
uses: actions/[email protected]
60+
with:
61+
if-no-files-found: warn
62+
name: ${{ matrix.os }} Issues
63+
path: |
64+
BuildArtifacts/report.html
65+
BuildArtifacts/**/coverlet/*.xml
66+
- name: Upload Packages
67+
uses: actions/[email protected]
68+
if: runner.os == 'Windows'
69+
with:
70+
if-no-files-found: warn
71+
name: package
72+
path: BuildArtifacts/Packages/**/*

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin/
2+
obj/
3+
*.user
4+
BuildArtifacts/
5+
/tools/

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
<https://www.contributor-covenant.org/faq>. Translations are available at
128+
<https://www.contributor-covenant.org/translations>.

GitReleaseManager.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
create:
2+
include-footer: true
3+
footer-heading: Where to get it
4+
footer-content: >
5+
You can install this release via
6+
`dotnet tool install -g JavaVersionSwitcher`.
7+
footer-includes-milestone: true
8+
milestone-replace-text: "{milestone}"
9+
include-sha-section: true
10+
sha-section-heading: "SHA256 Hashes of the release artifacts"
11+
sha-section-line-format: "- `{1}\t{0}`"
12+
export:
13+
include-created-date-in-title: true
14+
created-date-string-format: yyyy-MM-dd
15+
perform-regex-removal: true
16+
regex-text: '[\r\n]*### Where to get it[\r\n]*You can .*`\.[\r\n]*'
17+
multiline-regex: true
18+
issue-labels-include:
19+
- Breaking change
20+
- Bug
21+
- Feature
22+
- Enhancement
23+
- Improvement
24+
- Documentation
25+
- security
26+
issue-labels-exclude:
27+
- Build
28+
- Internal / Refactoring
29+
issue-labels-alias:
30+
- name: Documentation
31+
header: Documentation
32+
plural: Documentation
33+
- name: security
34+
header: Security
35+
plural: Security
36+
close:
37+
use-issue-comments: true
38+
issue-comment: |-
39+
:tada: This issue has been resolved in version {milestone} :tada:
40+
The release is available on:
41+
- [GitHub Release](https://github.com/{owner}/{repository}/releases/tag/{milestone})
42+
- [NuGet Package](https://www.nuget.org/packages/JavaVersionSwitcher/{milestone})
43+
Your **[GitReleaseManager](https://github.com/GitTools/GitReleaseManager)** bot :package::rocket:

GitVersion.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
branches:
2+
master:
3+
regex: ^main$

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Nils Andresen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# JavaVersionSwitcher
2+
3+
[![standard-readme compliant][]][standard-readme]
4+
[![Build][githubimage]][githubbuild]
5+
[![NuGet package][nugetimage]][nuget]
6+
7+
> .NET tool to make switching java versions on windows easy.
8+
9+
## Table of Contents
10+
11+
- [Install](#install)
12+
- [Usage](#usage)
13+
- [Changes to the system](#changes-to-the-system)
14+
- [Discussion](#discussion)
15+
- [Maintainer](#maintainer)
16+
- [Contributing](#contributing)
17+
- [Contributors](#contributors)
18+
- [License](#license)
19+
20+
## Install
21+
22+
```cmd
23+
dotnet tool install -g JavaVersionSwitcher
24+
```
25+
26+
## Usage
27+
28+
This tool is tested and works on windows. I'm not sure if anything works on non-windows systems.
29+
(In fact I am quite sure that it will probably not work at all on non-windows systems.)
30+
31+
```cmd
32+
REM show all java versions currently installed
33+
dotnet jvs scan
34+
35+
REM check if the java setup is "ok". (Checks %PATH% and %JAVA_HOME%)
36+
dotnet jvs check
37+
38+
REM switch to another java version
39+
dotnet jvs switch
40+
```
41+
42+
### Changes to the system
43+
44+
After running `dotnet jvs switch` the environment variables `JAVA_HOME` and `PATH` will be modified.
45+
It is necessary to close the current terminal and open a new one to refresh the environment.
46+
47+
## Maintainer
48+
49+
[Nils Andresen @nils-a][maintainer]
50+
51+
## Contributing
52+
53+
JavaVersionSwitcher follows the [Contributor Covenant][contrib-covenant] Code of Conduct.
54+
55+
We accept Pull Requests.
56+
57+
Small note: If editing the Readme, please conform to the [standard-readme][] specification.
58+
59+
This project follows the [all-contributors][] specification. Contributions of any kind welcome!
60+
61+
## License
62+
63+
[MIT License © Nils Andresen][license]
64+
65+
[githubbuild]: https://github.com/nils-org/JavaVersionSwitcher/actions/workflows/build.yml?query=branch%3Adevelop
66+
[githubimage]: https://github.com/nils-org/JavaVersionSwitcher/actions/workflows/build.yml/badge.svg?branch=develop
67+
[maintainer]: https://github.com/nils-a
68+
[nuget]: https://nuget.org/packages/JavaVersionSwitcher
69+
[nugetimage]: https://img.shields.io/nuget/v/JavaVersionSwitcher.svg?logo=nuget&style=flat-square
70+
[license]: LICENSE.txt
71+
[standard-readme]: https://github.com/RichardLitt/standard-readme
72+
[standard-readme compliant]: https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square

build.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$ErrorActionPreference = 'Stop'
2+
3+
Set-Location -LiteralPath $PSScriptRoot
4+
5+
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
6+
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
7+
$env:DOTNET_NOLOGO = '1'
8+
9+
dotnet tool restore
10+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
11+
12+
dotnet cake recipe.cake @args
13+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

0 commit comments

Comments
 (0)