Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberpwnn committed Sep 5, 2021
2 parents 2b6fdfd + 61cb60c commit 8c342f0
Showing 1 changed file with 96 additions and 19 deletions.
115 changes: 96 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
# Amulet
A very simple collections & general util api

[![Release](https://jitpack.io/v/ArcaneArts/Amulet.svg)](https://jitpack.io/#ArcaneArts/Amulet)

```groovy
maven { url 'https://jitpack.io' }
```

```groovy
implementation 'com.github.ArcaneArts:Amulet:JITPACK-VERSION'
// or you can use the latest cached release
// ~~~~(may be a version or two behind sometimes)
implementation 'com.github.ArcaneArts:Amulet:latest.release'
```

# Project Setup
To use Amulet in your project, there is some additional setup required. Please follow the setup instructions to ensure everything will work properly.
1. Make sure jitpack is a repo & you have added the dependency to your build.gradle
2. Install the Mantifold Plugin to Intellij (then restart)
1. In settings.gradle Add
```groovy
sourceControl {
gitRepository("https://github.com/ArcaneArts/Amulet.git") {
producesModule("art.arcane:Amulet")
}
}
````
3. Define the dependency as `implementation art.arcane:Amulet:<TAG>` such as 1.0.2
4. Install the Mantifold Plugin to Intellij (then restart)
* Note: You do not need to buy a license, use CTRL + SHIFT + A > Manage Licenses > Mantifold > Evaluate 30 Days (once expired, it will still work but may remind you to register). Though you can just re-evaluate after that time.
3. Add this to the bottom of your build.gradle
5. Add this to the bottom of your build.gradle
```groovy
if (JavaVersion.current() != JavaVersion.VERSION_1_8 &&
sourceSets.main.allJava.files.any {
Expand All @@ -36,17 +30,100 @@ To use Amulet in your project, there is some additional setup required. Please f
}
}
```
4. (OPTIONAL) If you use unit testing with Amulet
5. (OPTIONAL) If you use unit testing with Amulet
```groovy
configurations {
testImplementation.extendsFrom annotationProcessor
}
```
5. (OPTIONAL) If you are a dependency to another project add
6. (OPTIONAL) If you are a dependency to another project add
```groovy
jar {
manifest {
attributes('Contains-Sources':'java,class')
}
}
```
7. Add Manifold Dependencies to your project
```groovy
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
implementation 'systems.manifold:manifold-ext-rt:2021.1.16'
annotationProcessor 'systems.manifold:manifold-ext:2021.1.16'
}
```
8. Resync Gradle project in Intellij (hit the refresh button)
9. On the gradle sidebar, run Tasks > build > build (:build). This will grab Amulet because Intellij does not do this by re-syncing the project.
10. (OPTIONAL) Add the [lombok plugin](https://plugins.gradle.org/plugin/io.freefair.lombok) **ONLY THE PLUGIN** Do not add the dependencies or annotation processors, such as `id "io.freefair.lombok" version "6.1.0"`.
11. (OPTIONAL) Invalidate caches / restart
## Full Gradle Example
settings.gradle
```groovy
rootProject.name = 'ExampleProject' // TODO: CHANGE TO YOUR PROJECT NAME!!!
sourceControl {
gitRepository("https://github.com/ArcaneArts/Amulet.git") {
producesModule("art.arcane:Amulet")
}
}
```

build.gradle
```groovy
plugins {
id 'java'
id 'java-library' // Optional: For apis only
id "io.freefair.lombok" version "6.1.0" // Optional: For lombok
}
group 'art.arcane' // TODO: CHANGE TO YOUR GROUP NAME
version '1.0.0'
// Optional: Allow manifold in unit testing
configurations {
testImplementation.extendsFrom annotationProcessor
}
// Optional: Pass on our classes to those depending on us using manifold
jar {
manifest {
attributes('Contains-Sources':'java,class')
}
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'art.arcane:Amulet:1.0.2'
implementation 'systems.manifold:manifold-ext-rt:2021.1.16'
annotationProcessor 'systems.manifold:manifold-ext:2021.1.16'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}
test {
useJUnitPlatform()
}
if (JavaVersion.current() != JavaVersion.VERSION_1_8 &&
sourceSets.main.allJava.files.any {it.name == "module-info.java"}) {
tasks.withType(JavaCompile) {
// if you DO define a module-info.java file:
options.compilerArgs += ['-Xplugin:Manifold', '--module-path', it.classpath.asPath]
}
} else {
tasks.withType(JavaCompile) {
// If you DO NOT define a module-info.java file:
options.compilerArgs += ['-Xplugin:Manifold']
}
}
```

0 comments on commit 8c342f0

Please sign in to comment.