Skip to content

Commit

Permalink
Release 3.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fathzer committed May 29, 2024
1 parent 0aa3f9d commit 219389c
Show file tree
Hide file tree
Showing 157 changed files with 792 additions and 19,527 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/demo.yml
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
37 changes: 37 additions & 0 deletions .github/workflows/sonar.yml
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
31 changes: 31 additions & 0 deletions .github/workflows/tutorial.yml
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/bin
**/target
**/.project
**/.classpath
**/.settings
**/dependency-reduced-pom.xml
45 changes: 45 additions & 0 deletions DeliveryProcess.md
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`

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# javaluator
[![Javadocs](http://javadoc.io/badge/com.fathzer/javaluator.svg)](https://javadoc.io/doc/com.fathzer/javaluator) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.fathzer/javaluator/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.fathzer/javaluator) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.fathzer%3Ajavaluator&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.fathzer%3Ajavaluator)
# Javaluator
[![Javadocs](http://javadoc.io/badge/com.fathzer/javaluator.svg)](https://javadoc.io/doc/com.fathzer/javaluator) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.fathzer/javaluator/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.fathzer/javaluator) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fathzer_javaluator&metric=alert_status)](https://sonarcloud.io/dashboard?id=fathzer_javaluator)

A java infix evaluator based on "Shunting Yard" algorithm.

Expand All @@ -17,9 +17,9 @@ Key features:
- Extensible: Define your own grammar, or extends the existing one.
- Localizable: Define localized names for functions or constants.
- Syntax check
- Small footprint: 26kB, no additionnal library required.
- Small footprint: 26kB, no additional library required.
- Fully documented

Please visit the project site to learn more : http://javaluator.fathzer.com
Please visit the project's web site to learn more: https://javaluator.fathzer.com

If you use Javaluator in your product, we will be happy to add a link to your product in the Javaluator web site
If you use Javaluator in your product, we will be happy to add a link to your product in the Javaluator's web site.
57 changes: 17 additions & 40 deletions javaluator-demo/pom.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.fathzer</groupId>
<artifactId>parent-pom</artifactId>
<version>1.0.2</version>
<artifactId>javaluator-parent-pom</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>javaluator-demo</artifactId>
<version>3.0.2</version>

<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
<dependency>
<groupId>com.fathzer</groupId>
<artifactId>javaluator</artifactId>
<version>3.0.2</version>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>com.fathzer</groupId>
<artifactId>ajlib</artifactId>
<version>0.3.10</version>
<version>0.3.16</version>
</dependency>
</dependencies>

Expand All @@ -26,11 +34,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<version>3.5.3</version>
<configuration>
<finalName>javaluator-demo</finalName>
<minimizeJar>true</minimizeJar>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.fathzer.soft.javaluator.demo.DemoApplet</Main-Class>
</manifestEntries>
Expand All @@ -46,39 +56,6 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
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);
}
}
Loading

0 comments on commit 219389c

Please sign in to comment.