Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input loading from JSON file #80

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ mvn clean verify
This command also runs all the tests and checks configured for the code.


## Running the Executable

You can execute generated jar by:

```
java -jar ./target/assignment-1.0-SNAPSHOT.jar
```

It will load input data from file at path `./input.json`. `input.json` in the repository contains sample input.


## Documentation

The documentation is [available](https://dd2480-group14.github.io/Assignment-1/) online. It is generated via Javadoc from comments in the source code and deployed automatically after pull request merges into main branch.
Expand Down
2 changes: 1 addition & 1 deletion format.xml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="20"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
Expand Down
281 changes: 281 additions & 0 deletions input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
{
"POINTS": [
[0.0, 0.0],
[1.0, 1.0]
],
"LENGTH1": 2.0,
"PUV": [
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true
],
"LCM": [
[
"ANDD",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
],
[
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED",
"NOTUSED"
]
]
}
34 changes: 28 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20220924</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down Expand Up @@ -55,14 +60,31 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>org.json:json</artifact>
<excludes>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>assignment.Main</mainClass>
</manifest>
</archive>
</transformer>
</transformers>
</configuration>
</plugin>
</plugins>
Expand Down
Loading