Skip to content

Commit

Permalink
Simulation Engine basic logic (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas authored Oct 31, 2024
1 parent 8fb9bce commit 7359709
Show file tree
Hide file tree
Showing 45 changed files with 5,603 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: "πŸ› Bug Report"
description: Create a report to help us improve
labels: [bug]
body:
- type: textarea
id: description
attributes:
label: Describe the bug
description: What is the problem? A clear and concise description of the bug.
validations:
required: true

- type: textarea
id: current
attributes:
label: Current behavior
description: |
Please include full errors, uncaught exceptions, screenshots, and relevant logs.
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: Reproduction steps
description: |
Provide steps to reproduce the behavior.
validations:
required: false

- type: textarea
id: expected
attributes:
label: Expected behavior
description: |
What did you expect to happen?
validations:
required: false

- type: input
id: core-version
attributes:
label: OIS core version
validations:
required: false

- type: input
id: os-version
attributes:
label: Operating system type and version
validations:
required: true
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: ⭐️ Feature request
about: Suggest an idea for this project
title: ''
labels: feature request
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like to see**
A clear and concise description of the new feature.

**Describe alternatives you've considered**
If applicable, a clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: ❓ Question
about: Ask a question
title: ''
labels: question
assignees: ''

---
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [ ] All [tests](https://github.com/attiasas/ois-core/actions/workflows/test.yml) passed. If this feature is not already covered by the tests, I added new tests.
- [ ] If this feature effect users, update the [documentation](../README.md) and the [wiki](https://github.com/attiasas/ois-core/wiki)
- [ ] This feature was validated on all supported platforms
-----
20 changes: 20 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
changelog:
exclude:
labels:
- ignore for release
categories:
- title: Breaking Changes 🚨
labels:
- breaking change
- title: Exciting New Features πŸŽ‰
labels:
- new feature
- title: Improvements 🌱
labels:
- improvement
- title: Bug Fixes πŸ› 
labels:
- bug
- title: Other Changes πŸ“š
labels:
- "*"
54 changes: 54 additions & 0 deletions .github/workflows/reflection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "Test HTML Reflection not broken"
# Some classes may not reflect, to make sure we are not breaking the runners we search for known blacklist imports

on:
push:
branches:
- '**'
tags-ignore:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-blacklist-imports:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

# Install required tools
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "11"

- name: Define blacklisted packages and directories
run: |
# List of forbidden imports (blacklisted packages)
BLACKLIST=("java.nio.file")
# List of relative directories to search (after java/)
RELATIVE_SEARCH_DIRS=("runner" "state" "project" "tools" "utils/io/data" "utils/log")
# Base directory
BASE_DIR="src/main/java/org/ois/core"
# Loop over the blacklist
for forbidden_pkg in "${BLACKLIST[@]}"; do
# Search for forbidden imports in the specified relative directories
for dir in "${RELATIVE_SEARCH_DIRS[@]}"; do
FULL_PATH="$BASE_DIR/$dir"
if grep -rnw "$FULL_PATH" -e "import $forbidden_pkg" --include \*.java; then
echo "Error: Found forbidden import: $forbidden_pkg in $dir"
exit 1
fi
done
done
echo "No forbidden imports found."
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Test"

on:
push:
branches:
- '**'
tags-ignore:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }}
cancel-in-progress: true

jobs:
unit-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# Install required tools
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "11"
- name: Give permission to gradlew
run: chmod +x gradlew
if: runner.os != 'Windows'
# Run tests
- name: Tests on macOS, Linux
run: ./gradlew clean test
if: runner.os != 'Windows'
- name: Tests on Windows
run: ./gradlew.bat clean test
if: runner.os == 'Windows'
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Gradle
.gradle

# Intellij idea
.idea
/target
/out
/build
*.iml

# IOS
.DS_Store

# Misc
.java-version
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# βš’οΈ Building the library

To build the library sources, please follow these steps:

1. Clone the code from Git.
2. Build the library sources and publish it locally, run the following Gradle command:
<details open>
<summary>windows</summary>

```bash
./gradlew.bat publishToMavenLocal
```
</details>
<details>
<summary>Mac / Linux</summary>

```bash
./gradlew publishToMavenLocal
```
</details>

---

# πŸ§ͺ Testing the plugin

To test the library sources, please follow these steps:
<details open>
<summary>windows</summary>

```bash
./gradlew.bat clean check
```
</details>
<details>
<summary>Mac / Linux</summary>

```bash
./gradlew clean check
```
</details>
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
# ois-core
<div align="center">

# open-interactive-simulation-core

[![Test](https://github.com/attiasas/ois-core/actions/workflows/test.yml/badge.svg)](https://github.com/attiasas/ois-core/actions/workflows/test.yml?branch=master)

</div>

## Table of Contents
- [πŸ“š Overview](#-overview)
- [πŸ—οΈ Usage](#-usage)
- [🐞 Reporting Issues](#-reporting-issues)
- [🀝 Contributions](#-contributions)

---
## πŸ“š Overview

Welcome to the world of simplicity and efficiency in [LibGdx](https://libgdx.com/) development!
This library is designed to streamline your journey in creating LibGdx projects.
By providing a foundational implementation of key LibGdx features, we free you from the complexities of project configuration.
This way, you can focus your efforts on crafting content specific to your simulation, without getting bogged down in technical details.

In essence, this library acts as a bridge, abstracting and implementing essential features.
Its role is to empower you to concentrate on building simulation-specific content, rather than grappling with the intricacies of project setup.

But that's not all. This library is the bedrock upon which other OIS products are built:
* [OIS Gradle Plugin](https://github.com/attiasas/ois-gradle-plugin) - A Gradle plugin designed for the development, execution, and deployment of OIS simulation projects.

Join us on this journey to simplify your development process and create amazing simulations with ease.

---
## πŸ—οΈ Usage

Discover the steps for implementing an OIS project by exploring our comprehensive [Wiki page](https://github.com/attiasas/ois-core/wiki).

---
## 🐞 Reporting Issues

We highly recommend running Gradle with the ```-d```
option to get useful and readable debug information if something goes wrong with your build.

Please help us improve the library
by [reporting any issues](https://github.com/attiasas/ois-core/issues/new/choose) you encounter.

---
## 🀝 Contributions

We welcome pull requests from the community. To help us improve this project, please read
our [Contribution](CONTRIBUTING.md) guide.
Loading

0 comments on commit 7359709

Please sign in to comment.