-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
157 changed files
with
792 additions
and
19,527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# This workflow build the demonstration application and publish it in Github pages. | ||
name: Demo | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
name: Demo | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 8 | ||
distribution: 'zulu' # Alternative distribution options are available. | ||
- name: Cache Maven packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
run: | | ||
mvn -P demo package | ||
mkdir ./demo | ||
mv ./javaluator-demo/target/javaluator-demo.jar ./demo | ||
ls -l ./demo/* | ||
- name: Build with Jekyll | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./demo | ||
destination: ./_site | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
|
||
# Deployment job | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Sonar | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
build: | ||
name: Build and analyze | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: 'zulu' # Alternative distribution options are available. | ||
- name: Cache SonarCloud packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.sonar/cache | ||
key: ${{ runner.os }}-sonar | ||
restore-keys: ${{ runner.os }}-sonar | ||
- name: Cache Maven packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Build and analyze | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: mvn -P sonar -B org.jacoco:jacoco-maven-plugin:prepare-agent test org.jacoco:jacoco-maven-plugin:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=fathzer_javaluator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow checks that the examples contained in javaluator's tutorial in private project "fathzer/hosting" is up to date. | ||
# It requires a REPO_READ_TOKEN personal access token that can checkout this repository. | ||
name: Tutorial check | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Tuto check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check out hosting | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: fathzer/hosting | ||
sparse-checkout: javaluator | ||
path: './hosting' | ||
|
||
- name: seeMe | ||
run: | | ||
chmod +x ./javaluator-examples/detectDiff.sh | ||
./javaluator-examples/detectDiff.sh ./hosting/javaluator/www/en/doc/tutorial ./javaluator-examples/src/main/java/com/fathzer/soft/javaluator/examples | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/bin | ||
**/target | ||
**/.project | ||
**/.classpath | ||
**/.settings | ||
**/dependency-reduced-pom.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Delivery process. | ||
|
||
## Deploy the artifact on Maven central | ||
|
||
1. Push the code in `master` branch. | ||
It will trigger some workflows. Please note that `tutorial` workflow may fail! It only means [Javaluator tutorial on Javaluator's site](https://javaluator.fathzer.com) require some updates. | ||
If Sonar quality gate fail ... try to fix its complaints ;-) | ||
|
||
2. Run `mvn clean deploy` on the project. | ||
As the compiler target is Java 1.6, it will fail with recent release of Java. Java 8 is able to make the compile. | ||
The easiest way to use java 8 is to [configure a *toolchain*](#HowToConfigureToolchain). | ||
Of course, signing material (certificate and its password) are not included in this project: There should be `fathzer_private_key.asc` and `fathzer_key_pwd.txt` files in the user's home directory. | ||
|
||
3. Create a release in Github. | ||
|
||
## Javaluator's site update | ||
|
||
1. Update the [`father/hosting`](https://github.com/fathzer/hosting) private project. | ||
- If the `tutorial` workflow fails, have a look at its logs, it should contains the list of files that should be updated in the project. Once the project is updated, retry the failed action, it should succeed. | ||
|
||
- Add the version release notes to the `javaluator/www/en/doc/relnotes.txt` file. | ||
|
||
2. Don't forget to push the updates in the production site! | ||
|
||
## How to configure toolchain | ||
Add a *toolchain.xml* file](#HowToConfigureToolchain) in your `.m2` directory. | ||
|
||
This file should contain something like: | ||
``` | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<toolchains> | ||
<toolchain> | ||
<type>jdk</type> | ||
<provides> | ||
<version>8</version> | ||
<vendor>sun</vendor> | ||
</provides> | ||
<configuration> | ||
<jdkHome>C:\Program Files\Java\jdk1.8.0_341</jdkHome> | ||
</configuration> | ||
</toolchain> | ||
<toolchains> | ||
``` | ||
Once it is done, java 8 is activated with the `jdk` system property: `mvn -Djdk=8 clean deploy` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 3 additions & 21 deletions
24
javaluator-demo/src/main/java/com/fathzer/soft/javaluator/demo/DemoApplet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
package com.fathzer.soft.javaluator.demo; | ||
|
||
import javax.swing.JApplet; | ||
import javax.swing.JFrame; | ||
import javax.swing.SwingUtilities; | ||
import javax.swing.WindowConstants; | ||
|
||
@SuppressWarnings("serial") | ||
public class DemoApplet extends JApplet { | ||
// Called when this applet is loaded into the browser. | ||
public void init() { | ||
// Execute a job on the event-dispatching thread; creating this applet's GUI. | ||
try { | ||
SwingUtilities.invokeAndWait(new Runnable() { | ||
public void run() { | ||
DemoPanel lbl = new DemoPanel(); | ||
add(lbl); | ||
} | ||
}); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
System.err.println("createGUI didn't complete successfully"); | ||
} | ||
} | ||
|
||
public class DemoApplet { | ||
public static void main(String[] args) { | ||
JFrame frame = new JFrame("Javaluator demo"); | ||
frame.setContentPane(new DemoPanel()); | ||
frame.pack(); | ||
frame.setVisible(true); | ||
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); | ||
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); | ||
} | ||
} |
Oops, something went wrong.