Skip to content

Commit

Permalink
docs: add web page
Browse files Browse the repository at this point in the history
  • Loading branch information
tamada committed Dec 14, 2021
1 parent 7232bb3 commit c64c0d7
Show file tree
Hide file tree
Showing 27 changed files with 493 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "site/themes/cayman-hugo-theme"]
path = site/themes/cayman-hugo-theme
url = https://github.com/zwbetz-gh/cayman-hugo-theme.git
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# building minimal jdk
FROM openjdk:17.0.1-slim AS base

# create minimal jdk
RUN /usr/local/openjdk-17/bin/jlink \
--compress=2 \
--add-modules jdk.zipfs \
--no-header-files \
--no-man-pages \
--output /opt/openjdk-17-minimal

# building pochi
FROM alpine:3.10.1

ARG Version="1.0.0-SNAPSHOT"

LABEL maintainer="Haruaki Tamada" \
chclver-version="${PochiVersion}" \
description="change class files' versions"

COPY --from=base /opt/openjdk-17-minimal /opt/openjdk-17-minimal

RUN apk --no-cache --virtual .builddeps add curl unzip \
&& ln -s /opt/openjdk-17-minimal /opt/java \
&& echo 'https://www.dropbox.com/s/wmi32z0db7js86k/chclver-1.0.0-SNAPSHOT-distribution.zip?dl=0' \
&& curl -L 'https://www.dropbox.com/s/wmi32z0db7js86k/chclver-${Version}-distribution.zip?dl=0' -o /tmp/chclver.zip \
# && curl -L https://github.com/tamada/chclver/releases/download/v${Version}/chclver-${Version}.zip -o /tmp/chclver.zip
&& unzip -q /tmp/chclver.zip -d /opt \
&& ln -s /opt/chclver-${Version} /opt/chclver \
&& rm -rf /opt/chclver/{docs,completions} \
# add user
&& adduser -D chclver \
# remove installed package
&& rm -f /tmp/chclver.zip \
&& apk del --purge .builddeps \

ENV CHCLVER_HOME="/opt/chclver"
ENV JAVA_HOME="/opt/java"
ENV PATH="$PATH:$JAVA_HOME/bin:$CHCLVER_HOME/bin"
ENV HOME="/home/chclver"

WORKDIR /home/chclver
USER chclver

ENTRYPOINT [ "chclver" ]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![codebeat badge](https://codebeat.co/badges/50cf2989-ec6b-467c-9f63-1856478f94d4)](https://codebeat.co/projects/github-com-tamada-chclver-main)

[![License Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-green?logo=apache)](https://github.com/tamada/chclver/blob/main/LICENSE) [![Version 1.0.0-SNAPSHOT](https://img.shields.io/badge/Version-1.0.0--SNAPSHOT-green)](https://github.com/tamada/chclver/releases/tag/v1.0.0)
[![License Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-green?logo=apache)](https://github.com/tamada/chclver/blob/main/LICENSE) [![Version 1.0.0-SNAPSHOT](https://img.shields.io/badge/Version-1.0.0--SNAPSHOT-green)](https://github.com/tamada/chclver/releases/tag/v1.0.0) [![GitHub Discussion](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/tamada/chclver/discussions)

Change class file versions.

Expand Down Expand Up @@ -62,6 +62,12 @@ mvn package

## :smile: About

### :speech_balloon: Discussions

[![GitHub Discussion](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/tamada/chclver/discussions)

Please post the message.

### :man_cook: How to Contribute :woman_cook:

1. Fork it (https://github.com/tamada/chclver)
Expand Down
58 changes: 48 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<licenses>
<license>
<name>Apache-2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
Expand Down Expand Up @@ -71,12 +71,6 @@
<version>2.6.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.vavr</groupId>
<artifactId>vavr</artifactId>
Expand Down Expand Up @@ -111,6 +105,19 @@
<artifactId>license-maven-plugin</artifactId>
<version>4.1</version>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.5.0.0</version>
<dependencies>
<!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<version>4.5.2</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
Expand All @@ -129,6 +136,16 @@
<staticAfter>true</staticAfter>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<descriptors>
<descriptor>src/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -216,6 +233,19 @@
</pluginManagement>

<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<executions>
<execution>
<id>spotbugs</id>
<phase>package</phase>
<goals>
<goal>spotbugs</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -227,9 +257,8 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<outputDirectory>${project.build.directory}/mods</outputDirectory>
<includeScope>compile</includeScope>
<excludeArtifactIds>asm</excludeArtifactIds>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -275,7 +304,7 @@
<argument>picocli.AutoComplete</argument>
<argument>--force</argument><!-- overwrite if exists -->
<argument>--completionScript</argument>
<argument>${project.build.directory}/completion.sh</argument>
<argument>${project.build.directory}/chclver-completions.sh</argument>
<argument>jp.cafebabe.chclver.cli.Arguments</argument><!-- replace with your class -->
</arguments>
</configuration>
Expand All @@ -296,6 +325,15 @@
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.1.2</version>
</plugin>
</plugins>
</reporting>

Expand Down
24 changes: 24 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### https://raw.github.com/github/gitignore/ce6f84024931408ce801808fe9f4587f7588b283/community/Golang/Hugo.gitignore

# Generated files by hugo
/public/
/resources/_gen/

# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux


### https://raw.github.com/github/gitignore/ce6f84024931408ce801808fe9f4587f7588b283/community/Golang/Hugo.gitignore

# Generated files by hugo
/public/
/resources/_gen/

# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux


29 changes: 29 additions & 0 deletions site/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
baseURL = 'https://tamada.github.io/chclver'
languageCode = 'en-us'
title = 'chclver'
enableEmoji = true
paginate = 10
hasCJKLanguage = false
theme = "cayman-hugo-theme"

[params]
project_name = "chclver"
project_tagline = "Change class files' versions"
project_logo = "images/logo.svg"
dateFormat = "Jan 02, 2006"
footer = "[![GitHub](https://img.shields.io/badge/GitHub-tamada/chclver-blueviolet.svg?logo=github)](https://github.com/tamada/chclver) Made with [Hugo](https://gohugo.io/). Theme by [Cayman](https://github.com/zwbetz-gh/cayman-hugo-theme). Deployed to [GitHub Pages](https://pages.github.com/)."
katex = true

[menu]
[[menu.nav]]
name = ":house: Home"
url = "/"
weight = 1
[[menu.nav]]
name = ":anchor: Usage &amp; Install"
url = "/usage/"
weight = 2
[[menu.nav]]
name = ":smile: About"
url = "/about/"
weight = 3
23 changes: 23 additions & 0 deletions site/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: ":house: chclver"
---

[![Build](https://github.com/tamada/chclver/actions/workflows/maven.yml/badge.svg)](https://github.com/tamada/chclver/actions/workflows/maven.yml) [![Coverage Status](https://coveralls.io/repos/github/tamada/chclver/badge.svg?branch=main)](https://coveralls.io/github/tamada/chclver?branch=main)

[![codebeat badge](https://codebeat.co/badges/50cf2989-ec6b-467c-9f63-1856478f94d4)](https://codebeat.co/projects/github-com-tamada-chclver-main)

[![License Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-green?logo=apache)](https://github.com/tamada/chclver/blob/main/LICENSE) [![Version 1.0.0-SNAPSHOT](https://img.shields.io/badge/Version-1.0.0--SNAPSHOT-green)](https://github.com/tamada/chclver/releases/tag/v1.0.0) [![GitHub Discussion](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/tamada/chclver/discussions)

Change class file versions.

## :speaking_head: Overview

This tool manipulates the class files' version (`major_version` and `minor_version`).

The main features are as follows.

1. Print the version of the given class files.
2. Update the version of the given class files to the specified version.
3. List the class files' version and corresponding JVM version.


41 changes: 41 additions & 0 deletions site/content/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: ":smile: About"
---

### :speech_balloon: Discussions

[![GitHub Discussion](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/tamada/chclver/discussions)

Please post the message.

### :man_cook: How to Contribute :woman_cook:

1. Fork it (https://github.com/tamada/chclver)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Run test suite (`mvn package`)
4. Commit your changes (`git commit -m 'feat: Add some feature'`)
* Should follow [Conventional commits](https://www.conventionalcommits.org/) to the commit messages.
5. Push to the branch (`git push origin my-new-feature`)
6. Create a new pull request

### :man_office_worker: Developers :woman_office_worker:

* Haruaki Tamada ([tamada](https://github.com/tamada))

### :scroll: License

[![License Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-green?logo=apache)](https://github.com/tamada/chclver/blob/main/LICENSE)

> Copyright 2021 Haruaki TAMADA
>
> 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.
45 changes: 45 additions & 0 deletions site/content/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: ":anchor: Usage & Install"
---

## :runner: Usage

```sh
chclver [OPTIONS] <JAR|CLASS_FILE|DIRECTORY...>
OPTIONS
-d, --destination <DEST> specify the destination. Default is chclver directory.
--list-versions list version of class files and corresponding Java version.
--to <JAVA_VERSION> specify the Java version for updating to (e.g., Java7,
Java17). If this option is absent, print the versions
of the given class files.
--force-to <MAJOR.MINOR> specify the versions of the class files directory.
-v, --verbose verbose mode.
-h, --help print this message.
```

The JVM class files have major and minor versions to distinguish the target JVM. The format of the class files is defined in [the JVM specification](https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.1).

`chclver` prints/updates class files' version by reading JVM class files.

## :anchor: Install

### :beer: Homebrew

Install `chclver` via [Homebrew](https://brew.sh) to run the following commands.

```sh
brew tap tamada/brew # at the first time only
brew install chclver
```

If you want to install native commands, use `chclver-native` instead of `chclver` (not yet).

### :muscle: Compile yourself

Get source codes by `git clone` or download from [GitHub](https://github.com/tamada/chclver), then run `mvn` to build `chclver`.

```sh
git clone https://github.com/tamada/chclver.git
cd chclver
mvn package
```
18 changes: 18 additions & 0 deletions site/layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ define "main" }}
<h1>{{ .Title | emojify }}</h1>

{{ .Content | emojify }}

<ul>
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range $pages.ByPublishDate.Reverse }}
<li>
{{ $dateFormat := $.Site.Params.dateFormat | default "Jan 2, 2006" }}
{{ .PublishDate.Format $dateFormat }}
<a href="{{ .Permalink }}">
{{ .Title | emojify }}
</a>
</li>
{{ end }}
</ul>
{{ end }}
4 changes: 4 additions & 0 deletions site/layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ define "main" }}
<h1>{{ .Title | emojify }}</h1>
{{ .Content | emojify }}
{{ end }}
6 changes: 6 additions & 0 deletions site/layouts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ define "main" }}
<h1>{{ .Title | emojify }}</h1>

{{ .Content | emojify }}

{{ end }}
4 changes: 4 additions & 0 deletions site/layouts/partials/head-custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<link rel="stylesheet" href="{{ "css/chclver.css" | absURL }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css">

<script src="https://unpkg.com/mermaid@8.4.2/dist/mermaid.min.js"></script>
Loading

0 comments on commit c64c0d7

Please sign in to comment.