Skip to content

Commit

Permalink
Merge pull request #25 from rwth-acis/develop
Browse files Browse the repository at this point in the history
Gradle & las2peer v1.1.1
  • Loading branch information
pedela authored Feb 23, 2021
2 parents 8cb0583 + 0ffcf7b commit 3e29544
Show file tree
Hide file tree
Showing 19 changed files with 613 additions and 435 deletions.
10 changes: 0 additions & 10 deletions .classpath

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

# Triggers the workflow on push or pull request events (on every branch)
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- uses: codecov/codecov-action@v1
with:
files: ./template_project/export/jacoco/test/jacocoTestReport.xml
14 changes: 12 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/output/
/export/
/template_project/output/
/template_project/export/
/node-storage/
/.las2peer/
/tmp/
/log/
/template_project/log/
/lib/
/etc/ivy/ivy.jar
/service/
Expand All @@ -17,3 +18,12 @@
/etc/startup/
*.secret
archiva_credentials.xml
.classpath
.project
.settings

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
17 changes: 0 additions & 17 deletions .project

This file was deleted.

13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

38 changes: 15 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
<img src="https://raw.githubusercontent.com/rwth-acis/las2peer/master/img/logo/bitmap/las2peer-logo-128x128.png" />
</p>
<h1 align="center">las2peer-Template-Project</h1>
<p align="center">
<a href="https://travis-ci.org/rwth-acis/las2peer-template-project" alt="Travis Build Status">
<img src="https://travis-ci.org/rwth-acis/las2peer-template-project.svg?branch=master" /></a>
<a href="https://codecov.io/gh/rwth-acis/las2peer-template-project" alt="Code Coverage">
<img src="https://codecov.io/gh/rwth-acis/las2peer-template-project/branch/master/graph/badge.svg" /></a>
<a href="https://libraries.io/github/rwth-acis/las2peer-template-project" alt="Dependencies">
<img src="https://img.shields.io/librariesio/github/rwth-acis/las2peer-template-project" /></a>
</p>

![Java CI with Gradle](https://github.com/rwth-acis/las2peer-template-project/workflows/Java%20CI%20with%20Gradle/badge.svg?branch=master)
[![codecov](https://codecov.io/gh/rwth-acis/las2peer-template-project/branch/master/graph/badge.svg)](https://codecov.io/gh/rwth-acis/las2peer-template-project)
[![Dependencies](https://img.shields.io/librariesio/github/rwth-acis/las2peer-template-project)](https://libraries.io/github/rwth-acis/las2peer-template-project)

This project can be used as a starting point for your las2peer service development.
It contains everything needed to start las2peer service development, you do not need to add any dependencies manually.
Expand All @@ -27,7 +22,7 @@ las2peer uses **Java 14**.

### Build Dependencies

* Apache ant
* Gradle


## Quick Setup of your Service Development Environment
Expand All @@ -36,22 +31,19 @@ las2peer uses **Java 14**.
[Step by Step - First Service](https://github.com/rwth-acis/las2peer-Template-Project/wiki/Step-By-Step:-First-Service)
tutorial for a more detailed guidance on how to use this template.*

Follow these five steps to setup your project:
1. If you use Eclipse, import this project or just create a new project in the same folder.
2. Run "ant get_deps" once to pull all dependencies (You can skip this but Eclipse will complain about missing libraries until you build the first time).
3. The service source code can be found at `i5.las2peer.services.servicePackage.TemplateService`.
(3.5 Optional: Change [etc/ant_configuration/service.properties](etc/ant_configuration/service.properties) and [etc/ant_configuration/user.properties](etc/ant_configuration/user.properties)
according to the service you want to build. Rename your build directory structure according to the names you gave in 2.,
you have to also correct the package declaration and the 'testTemplateService' constant in your source code files.)
4. Compile your service with `ant jar` or just `ant` (default target). This will also build the service jar.
5. Generate documentation, run your JUnit tests and generate service and user agent with `ant all` (If this did not run check that the policy files are working correctly).

The jar file with your service will be in "export/" and "service/" and the generated agent XML files in "etc/startup/".
You can find the JUnit reports in the folder "export/test_reports/".
Follow these four steps to setup your project:
1. If you use Eclipse (for our guides we are using version 2020-12), import this project (as Gradle -> Existing Gradle Project). Please make sure, that JavaSE-14 is available in Eclipse (check under Window -> Preferences -> Java -> Installed JREs -> Execution Environments). During the import process, the .classpath files will be generated automatically.
2. The service source code can be found at `i5.las2peer.services.templateService.TemplateService`.
(Optional: Change [gradle.properties](gradle.properties)
according to the service you want to build. Rename your build directory structure according to the names you gave.)
3. Compile your service with `gradle clean jar`. This will also build the service jar.
4. Generate documentation, run your JUnit tests and generate service and user agent with `gradle clean build` (If this did not run check that the policy files are working correctly).

If you decide to change the dependencies of your project, please make sure to run "ant clean_all" to remove all previously
added libraries first.
The jar file with your service will be in "template_project/export/" and "service/" and the generated agent XML files in "etc/startup/".
You can find the JUnit reports in the folder "template_project/build/reports/tests/".

If you decide to change the dependencies of your project, please make sure to refresh the Gradle project in Eclipse by right-clicking on your project and then choosing Gradle -> Refresh Gradle Project.
Also run "gradle cleanAll" to remove all previously added libraries.

## Next Steps

Expand Down
Loading

0 comments on commit 3e29544

Please sign in to comment.