Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.rubenmayayo:JRAW:0.8.0'
}
dependencies {
implementation("com.github.rubenmayayo:JRAW:0.8.0")
}
<dependency>
<groupId>com.github.rubenmayayo</groupId>
<artifactId>JRAW</artifactId>
<version>0.8.0</version>
</dependency>
libraryDependencies += "com.github.rubenmayayo" % "JRAW" % "0.8.0"
:dependencies [[com.github.rubenmayayo/JRAW "0.8.0"]]
#Java Reddit API Wrapper
JRAW is currently in an experimental stage, and therefore subject to breaking API changes that could occur at any time.
Quick Note: Due to the fact that the unit tests rely on a solid internet connection and that the reddit API is working properly, a failing build does not necessarily mean that the library is currently unstable. For example, this build failed because reddit was having issues with SSL at the time. JRAW tries its best to recover from server errors, but it can only do so much.
##Notable Features
See Quickstart to get you up and running. Javadoc can be found here
##Building
JRAW uses Gradle as its build system. If you come from a Maven background, see Gradle's user guide to get you started.
gradle release
will generate four Jar files in build/releases
: a normal jar with just the library, a "fat" jar with all of JRAW's runtime dependencies, a Javadoc jar, and a sources jar. See here for an example.
gradle test
will run the unit tests
##Contributing
Before contributing, it is recommended that you have a decent knowledge of how the reddit API works.
Some references:
####Want to contribute? Follow these steps:
src/test/resources/credentials.json
. It should be in this format. If you don't have a testing user, see below.gradle test
ENDPOINTS.md
and Endpoints.java
by running gradle endpoints:update
(see the wiki)####Creating a user for unit testing
Here's how to create a testing user:
src/test/resources/credentials.json