Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed Apr 8, 2022
2 parents 2eba07c + 1deddde commit 4d5af02
Show file tree
Hide file tree
Showing 633 changed files with 49,554 additions and 54,927 deletions.
1 change: 1 addition & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<classpathentry exported="true" kind="lib" path="lib/rsyntaxtextarea/rsyntaxtextarea.jar" sourcepath="lib/rsyntaxtextarea/RSyntaxTextArea-3.1.1-light.zip"/>
<classpathentry exported="true" kind="lib" path="lib/jhexview/jhexview.jar" sourcepath="lib/jhexview/jhexview-current.zip"/>
<classpathentry exported="true" kind="lib" path="lib/montemedia/montemedia.jar" sourcepath="lib/montemedia/MonteMedia-0.7.7.zip"/>
<classpathentry exported="true" kind="lib" path="lib/apng-writer/apng-writer-core.jar" sourcepath="lib/apng-writer/apng-writer-core-src.zip"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
27 changes: 9 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Argent77/NearInfinity?color=darkred&include_prereleases&label=latest%20release)](https://GitHub.com/Argent77/NearInfinity/releases/latest)
[![GitHub release date (latest by date)](https://img.shields.io/github/release-date/Argent77/NearInfinity?color=gold)](https://GitHub.com/Argent77/NearInfinity/releases/latest)
[![Github downloads (total)](https://img.shields.io/github/downloads/Argent77/NearInfinity/total.svg?color=blueviolet)](https://GitHub.com/Argent77/NearInfinity/releases)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b5d10ca2684c4e30b6632e34584f1241)](https://www.codacy.com/manual/Mingun/NearInfinity)

# Near Infinity

A file browser and editor for the Infinity Engine. You can find out more in
the [Near Infinity Wiki](https://github.com/NearInfinityBrowser/NearInfinity/wiki).
the [Near Infinity Wiki](https://github.com/NearInfinityBrowser/NearInfinity/wiki), or download it directly from the
[Releases section](https://github.com/Argent77/NearInfinity/releases).

## How to build Near Infinity

**Required tools:**
- [Oracle's Java SE Development Kit 8 or later](https://www.oracle.com/java/technologies/downloads/), or [OpenJDK 8 or later](https://adoptium.net/releases.html)
- [Apache Ant](http://ant.apache.org/)
- [Oracle's Java SE Development Kit 8 or later](https://www.oracle.com/java/technologies/downloads/),
or [OpenJDK 8 or later](https://adoptium.net/releases.html)
- [Apache Ant](https://ant.apache.org/)

If you wish to compile Near Infinity from source, the easiest way to do so is
by using the included Ant build script. The default target builds the `NearInfinity.jar`.
Expand All @@ -22,12 +23,13 @@ cd NearInfinity
ant
```

The sources also contain configuration files for the [Eclipse IDE](http://www.eclipse.org/).
The sources also contain configuration files for the [Eclipse IDE](https://www.eclipse.org/).
It is preferred to use `Apache Ant` for compiling Near Infinity, however.

### Recreate parse tree

NI's BCS compiler uses code that is generated by the parser generator JavaCC. The file `src/org/infinity/resource/bcs/parser/BafParser.jjt` is used to build the parse tree.
NI's BCS compiler uses code that is generated by the parser generator JavaCC. The file
`src/org/infinity/resource/bcs/parser/BafParser.jjt` is used to build the parse tree.
Use the following commands if you need to recreate it:

```bash
Expand All @@ -38,17 +40,6 @@ ant parser-generate

The JavaCC executable is already included in the Near Infinity sources.

### Unit Tests

The unit tests (that currently have far from complete coverage) can be run by
passing `test` as the target parameter to ant:

```bash
cd NearInfinity
ant test
```
(This will compile the tests and run the tests on the last compiled build)

## Contributors

This section contains information intended for those who contribute
Expand Down Expand Up @@ -85,7 +76,7 @@ GitHub. The existing code is not always well-behaved in this regard,
however.

When in doubt, refer to the official
[Java conventions](http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html) (outdated)
[Java conventions](https://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html) (outdated)
or [Google's Java Style](https://google.github.io/styleguide/javaguide.html).

### Workflow
Expand Down
51 changes: 3 additions & 48 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,19 @@
<project name="NearInfinity" default="compile" basedir=".">
<property name="jar.file" value="NearInfinity.jar"/>
<property name="build.path" location="build/src"/>
<property name="build.test.path" location="build/test"/>
<property name="src.path" location="src"/>
<property name="test.path" location="test"/>
<property name="lib.path.rel" value="lib"/>
<property name="lib.path.abs" location="${lib.path.rel}"/>
<property name="jorbis.file" value="${lib.path.rel}/jorbis/jorbis.jar"/>
<property name="rsyntaxtextarea.file" value="${lib.path.rel}/rsyntaxtextarea/rsyntaxtextarea.jar"/>
<property name="jhexview.file" value="${lib.path.rel}/jhexview/jhexview.jar"/>
<property name="montemedia.file" value="${lib.path.rel}/montemedia/montemedia.jar"/>
<property name="junit.file" value="${lib.path.rel}/junit/junit-4.12.jar"/>
<property name="hamcrest.file" value="${lib.path.rel}/junit/hamcrest-core-1.3.jar"/>
<property name="antjunit.file" value="${lib.path.rel}/junit/ant-junit-1.9.7.jar"/>
<property name="antjunit4.file" value="${lib.path.rel}/junit/ant-junit4-1.9.7.jar"/>
<property name="apng_writer.file" value="${lib.path.rel}/apng-writer/apng-writer-core.jar"/>
<property name="javacc.home" value="lib/javacc"/>
<property name="parser.path" value="org/infinity/resource/bcs/parser"/>
<property name="src.parser.path" value="${src.path}/org/infinity/resource/bcs/parser"/>
<property name="parser.file" value="BafParser"/>

<path id="junit.class.path">
<pathelement location="${junit.file}"/>
<pathelement location="${hamcrest.file}"/>
<pathelement location="${build.path}"/>
</path>

<target name="compile" depends="clean">
<mkdir dir="${build.path}"/>

Expand All @@ -38,7 +27,7 @@
deprecation="false"
debug="false"
debuglevel="lines,vars,source"
classpath="${classpath}:${jorbis.file}:${rsyntaxtextarea.file}:${jhexview.file}:${montemedia.file}">
classpath="${classpath}:${jorbis.file}:${rsyntaxtextarea.file}:${jhexview.file}:${montemedia.file}:${apng_writer.file}">
<!-- Various debugging options: -->
<!-- <compilerarg value="-Xlint:cast"/> -->
<!-- <compilerarg value="-Xlint:deprecation"/> -->
Expand All @@ -61,6 +50,7 @@
<zipgroupfileset dir="." includes="${rsyntaxtextarea.file}"/>
<zipgroupfileset dir="." includes="${jhexview.file}"/>
<zipgroupfileset dir="." includes="${montemedia.file}"/>
<zipgroupfileset dir="." includes="${apng_writer.file}"/>
<manifest>
<attribute name="Main-Class" value="org.infinity.NearInfinity"/>
</manifest>
Expand All @@ -72,38 +62,6 @@
<javacc target="${src.parser.path}/${parser.file}.jj" outputdirectory="${src.parser.path}" javacchome="${javacc.home}"/>
</target>

<target name="test-compile" depends="test-clean">
<mkdir dir="${build.test.path}"/>

<javac srcdir="${test.path}"
destdir="${build.test.path}"
includeantruntime="false">
<classpath refid="junit.class.path" />
</javac>
</target>

<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath>
<pathelement location="${antjunit.file}"/>
<pathelement location="${antjunit4.file}"/>
</classpath>
</taskdef>

<target name="test" depends="test-compile">
<junit>
<classpath>
<path refid="junit.class.path"/>
<pathelement location="${build.test.path}"/>
</classpath>
<batchtest>
<fileset dir="${build.test.path}">
<include name="**/*Test.class"/>
</fileset>
</batchtest>
<formatter type="brief" usefile="false"/>
</junit>
</target>

<target name="clean">
<delete dir="${build.path}"/>
<delete file="${jar.file}"/>
Expand All @@ -122,7 +80,4 @@
</delete>
</target>

<target name="test-clean">
<delete dir="${build.test.path}"/>
</target>
</project>
28 changes: 28 additions & 0 deletions lib/apng-writer/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright (c) 2015, Weoulren
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of apng-writer nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Binary file added lib/apng-writer/apng-writer-core-src.zip
Binary file not shown.
Binary file added lib/apng-writer/apng-writer-core.jar
Binary file not shown.
Binary file removed lib/junit/ant-junit-1.9.7.jar
Binary file not shown.
Binary file removed lib/junit/ant-junit4-1.9.7.jar
Binary file not shown.
Binary file removed lib/junit/hamcrest-core-1.3.jar
Binary file not shown.
Binary file removed lib/junit/junit-4.12.jar
Binary file not shown.
Loading

0 comments on commit 4d5af02

Please sign in to comment.