Skip to content

Commit

Permalink
Release 22.02
Browse files Browse the repository at this point in the history
22.02
  • Loading branch information
Abbe98 authored Feb 7, 2022
2 parents 2809ce7 + 204de35 commit 5b3c5f1
Show file tree
Hide file tree
Showing 20 changed files with 4,676 additions and 9,460 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build
store
dist
nbproject\private
/nbproject/private/
bin
tmp
pattypan.jar
*.zip
36 changes: 5 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ __[:arrow_down: Download](https://github.com/yarl/pattypan/releases)__
----

### Build and run
Program is being written using [NetBeans IDE](https://netbeans.org/) and [Apache Ant](https://ant.apache.org/) is used for building. In order to download and build source code, do following:
[Apache Ant](https://ant.apache.org/) is used for building Pattypan. You need to have JDK 11 or later installed as well as [a download of OpenJFX](https://gluonhq.com/products/javafx/) for each platform you want to support. In order to download and build source code, do the following:

```
git clone https://github.com/yarl/pattypan.git
cd pattypan
ant package-for-store
ant
```
You will find compiled `.jar` file in `store` directory.

```
cd store
java -jar pattypan.jar
```
This will run the default `build` target. It assumes that the current directory contains the OpenJFX SDK ZIP(s) and will unpack the required files to the correct locations. The resulting JAR will support Linux, Windows or both. The ZIPs present dictates what platforms will be supported. Note that the ZIPs should have their default name to be included.

A temporary directory will be used during the build process and removed afterwards. It's default path is *tmp/* and can be set using `ant -Dtmp=...`

You can also set test server or any other server:

Expand All @@ -33,30 +31,6 @@ java -jar pattypan.jar wiki="test2.wikipedia.org" protocol="https://" scriptPath

Please note, that on test server file upload may be disabled for regular users. Admin account is suggested, you can request rights [here](https://test.wikipedia.org/wiki/Wikipedia:Requests/Permissions). If you have problems with program running, check [article on project wiki](https://github.com/yarl/pattypan/wiki/Run).

### Additional information for Ubuntu, Debian and Fedora based distributions
These linux distributions may require additional ```openjfx``` package. After installing Java on your system, download and install the ```openjfx``` package. You can install it by running:

```
sudo apt-get install openjfx
```

on your terminal.
You can also check this link: https://pkgs.org/download/openjfx for more information on ```openjfx``` package for these distributions.

Starting with Ubuntu 18.10 (and around the same time in Debian Sid), openjfx version 8 is no more shipped with the distribution. Though it is possible to force the openjfx to stay in version 8, and run pattypan, this is pretty much a hack. If you still wish to proceed, you can gain access to the Ubuntu 18.04 repository by adding the following line to your `/etc/apt/sources.list` file:

```
deb-src http://fr.archive.ubuntu.com/ubuntu/ bionic universe multiverse
```

You can then run these commands to perfom the installation and pin these versions:
```
apt purge openjfx
apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2
apt-mark hold openjfx libopenjfx-jni libopenjfx-java
```


### License
Copyright (c) 2016 Paweł Marynowski.

Expand Down
209 changes: 142 additions & 67 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,79 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?><!-- You may freely edit this file. See commented blocks below for --><!-- some examples of how to customize the build. --><!-- (If you delete it and reopen the project it will be recreated.) --><!-- By default, only the Clean and Build commands use this build script. --><project name="pattypan" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>Builds, tests, and runs the project pattypan.</description>
<import file="nbproject/build-impl.xml"/>
<!--
<project default="build" basedir=".">
<target name="build" depends="prepareJavfx, compile, jar, clean"/>
<property name="lib.dir" location="lib" />
<property name="tmp" location="tmp" />

There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. Those of them relevant for JavaFX project are:
<path id="classpath">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</path>

-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-jfx-jar: called before FX SDK specific <fx:jar> task
-post-jfx-jar: called after FX SDK specific <fx:jar> task
-pre-jfx-deploy: called before FX SDK specific <fx:deploy> task
-post-jfx-deploy: called after FX SDK specific <fx:deploy> task
-pre-jfx-native: called just after -pre-jfx-deploy if <fx:deploy> runs in native packaging mode
-post-jfx-native: called just after -post-jfx-deploy if <fx:deploy> runs in native packaging mode
-post-clean: called after cleaning build products
<target name="prepareJavfx">
<mkdir dir="${tmp}"/>
<unzip dest="${tmp}">
<fileset dir=".">
<include name="openjfx-*_linux-*_bin-sdk.zip"/>
</fileset>
<patternset>
<include name="**/javafx.base.jar"/>
<include name="**/javafx.graphics.jar"/>
<include name="**/javafx.controls.jar"/>
<include name="**/javafx.web.jar"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<unzip dest="bin">
<fileset dir="${tmp}">
<include name="javafx.base.jar"/>
<include name="javafx.graphics.jar"/>
<include name="javafx.controls.jar"/>
</fileset>
<patternset>
<exclude name="META-INF/MANIFEST.MF"/>
<exclude name="module-info.class"/>
</patternset>
</unzip>
<unzip dest="bin">
<fileset dir=".">
<include name="openjfx-*_linux-*_bin-sdk.zip"/>
</fileset>
<patternset>
<include name="**/libprism*.so"/>
<include name="**/libjavafx*.so"/>
<include name="**/libglass*.so"/>
</patternset>
<mapper type="flatten"/>
</unzip>

(Targets beginning with '-' are not intended to be called on their own.)
<unzip dest="${tmp}">
<fileset dir=".">
<include name="openjfx-*_windows-*_bin-sdk.zip"/>
</fileset>
<patternset>
<include name="**/javafx.base.jar"/>
<include name="**/javafx.graphics.jar"/>
<include name="**/javafx.controls.jar"/>
<include name="**/javafx.web.jar"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<unzip dest="bin">
<fileset dir="${tmp}">
<include name="javafx.base.jar"/>
<include name="javafx.graphics.jar"/>
<include name="javafx.controls.jar"/>
</fileset>
<patternset>
<exclude name="META-INF/MANIFEST.MF"/>
<exclude name="module-info.class"/>
</patternset>
</unzip>
<unzip dest="bin">
<fileset dir=".">
<include name="openjfx-*_windows-*_bin-sdk.zip"/>
</fileset>
<patternset>
<include name="**/prism*.dll"/>
<include name="**/javafx*.dll"/>
<include name="**/glass.dll"/>
<include name="**/api-ms-win-core-console-l1-1-0.dll"/>
<include name="**/api-ms-win-core-console-l1-2-0.dll"/>
<include name="**/msvcp140.dll"/>
<include name="**/vcruntime140_1.dll"/>
</patternset>
<mapper type="flatten"/>
</unzip>

Example of inserting a HTML postprocessor after javaFX SDK deployment:
<target name="-post-jfx-deploy">
<basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
<property name="jfx.deployment.html" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}.html"/>
<custompostprocess>
<fileset dir="${jfx.deployment.html}"/>
</custompostprocess>
</target>
Example of calling an Ant task from JavaFX SDK. Note that access to JavaFX SDK Ant tasks must be
initialized; to ensure this is done add the dependence on -check-jfx-sdk-version target:
<target name="-post-jfx-jar" depends="-check-jfx-sdk-version">
<echo message="Calling jar task from JavaFX SDK"/>
<fx:jar ...>
...
</fx:jar>
</target>
For more details about JavaFX SDK Ant tasks go to
http://docs.oracle.com/javafx/2/deployment/jfxpub-deployment.htm
For list of available properties check the files
nbproject/build-impl.xml and nbproject/jfx-impl.xml.
-->
<target name="package-for-store" depends="jar">
<property name="store.jar.name" value="pattypan"/>

<!-- don't edit below this line -->
<property name="store.dir" value="store"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>

<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
<delete dir="${store.dir}"/>
<mkdir dir="${store.dir}"/>
<unzip dest="${tmp}">
<fileset dir=".">
<include name="openjfx-*_osx-*_bin-sdk.zip"/>
</fileset>
<patternset>
<include name="**/javafx.base.jar"/>
<include name="**/javafx.graphics.jar"/>
<include name="**/javafx.controls.jar"/>
<include name="**/javafx.web.jar"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<unzip dest="bin">
<fileset dir="${tmp}">
<include name="javafx.base.jar"/>
<include name="javafx.graphics.jar"/>
<include name="javafx.controls.jar"/>
</fileset>
<patternset>
<exclude name="META-INF/MANIFEST.MF"/>
<exclude name="module-info.class"/>
</patternset>
</unzip>
<unzip dest="bin">
<fileset dir=".">
<include name="openjfx-*_osx-*_bin-sdk.zip"/>
</fileset>
<patternset>
<include name="**/libprism*.dylib"/>
<include name="**/libjavafx*.dylib"/>
<include name="**/libglass.dylib"/>
</patternset>
<mapper type="flatten"/>
</unzip>
</target>

<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
<zipgroupfileset dir="${dist.dir}" includes="*.jar"/>
<zipgroupfileset dir="lib" includes="*.jar"/>
<target name="compile">
<mkdir dir="bin"/>
<javac includeantruntime="false" srcdir="src" destdir="bin">
<classpath refid="classpath" />
<compilerarg line="--module-path ${tmp}"/>
<compilerarg line="--add-modules javafx.web"/>
</javac>
</target>

<target name="jar">
<copy todir="bin/pattypan">
<fileset dir="src/pattypan/" >
<include name="resources/**"/>
<include name="style/**"/>
<include name="text/**"/>
</fileset>
</copy>
<jar destfile="pattypan.jar" basedir="bin" includes="**/*">
<manifest>
<attribute name="Main-Class" value="pattypan.Main"/>
<attribute name="Class-Path" value="${lib.dir}"/>
<attribute name="Main-Class" value="pattypan.Launcher"/>
</manifest>
<zipgroupfileset dir="${lib.dir}"/>
</jar>
</target>

<zip destfile="${store.jar}">
<zipfileset src="${store.dir}/temp_final.jar"
excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
</zip>
<delete file="${store.dir}/temp_final.jar"/>
<target name="clean">
<delete dir="${tmp}"/>
<delete dir="bin"/>
</target>
</project>
3 changes: 0 additions & 3 deletions manifest.mf

This file was deleted.

Loading

0 comments on commit 5b3c5f1

Please sign in to comment.