Skip to content

Commit

Permalink
Merge be8db39 into e0d40df
Browse files Browse the repository at this point in the history
  • Loading branch information
soloturn committed Feb 28, 2021
2 parents e0d40df + be8db39 commit 6c4fff0
Show file tree
Hide file tree
Showing 38 changed files with 1,367 additions and 174 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/gradle.yml
@@ -0,0 +1,44 @@
name: CI + release

on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
java: [1.8]
include: # test newest java on one os only, upload from ubuntu java8
- os: ubuntu-latest
java: 1.15
- os: ubuntu-latest
upload: true

steps:
- uses: actions/checkout@v1
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Cache Gradle packages
# speed up the build by caching dependencies, downloaded versions
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew build
- name: upload jar as asset
if: matrix.upload
uses: actions/upload-artifact@v2
with:
name: zipped-ripme-jar
path: build/libs/*.jar

# vim:set ts=2 sw=2 et:
19 changes: 16 additions & 3 deletions .github/workflows/maven.yml
@@ -1,6 +1,6 @@
name: Java CI

on: [push, pull_request]
on: workflow_dispatch

jobs:
build:
Expand All @@ -9,7 +9,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
java: [1.8, 1.14]
java: [1.8]
include: # test newest java on one os only, upload from ubuntu java8
- os: ubuntu-latest
java: 1.15
- os: ubuntu-latest
upload: true

steps:
- uses: actions/checkout@v1
Expand All @@ -18,4 +23,12 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn package --file pom.xml
run: mvn -B package assembly:single --file pom.xml
- name: upload jar as asset
if: matrix.upload
uses: actions/upload-artifact@v2
with:
name: zipped-ripme-jar
path: target/*dependencies.jar

# vim:set ts=2 sw=2 et:
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -80,6 +80,12 @@ buildNumber.properties
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
!/.mvn/wrapper/maven-wrapper.jar

### gradle ###
/.gradle
/build
# Avoid ignoring gradle wrapper jar file (.jar files are usually ignored)
!/gradle/wrapper/gradle-wrapper.jar

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Expand Down
21 changes: 17 additions & 4 deletions README.md
Expand Up @@ -32,7 +32,7 @@ For information about running the `.jar` file, see [the How To Run wiki](https:/

On macOS, there is a [cask](https://github.com/Homebrew/homebrew-cask/blob/master/Casks/ripme.rb).
```
brew cask install ripme && xattr -d com.apple.quarantine /Applications/ripme.jar
brew install --cask ripme && xattr -d com.apple.quarantine /Applications/ripme.jar
```

## Changelog
Expand Down Expand Up @@ -77,14 +77,21 @@ If you're a developer, you can add your own Ripper by following the wiki guide:

# Compiling & Building

The project uses [Maven](http://maven.apache.org/).
To build the .jar file using Maven, navigate to the root project directory and run:
The project uses [Gradle](https://gradle.org) or [Maven](http://maven.apache.org/).
Therefor both commands are given. To build the .jar file, navigate to the root
project directory and run:

```bash
mvn clean compile assembly:single
mvn -B package assembly:single -Dmaven.test.skip=true
```
```bash
./gradlew clean build
./gradlew clean build -x test --warning-mode all
```

This will include all dependencies in the JAR.
This will include all dependencies in the JAR. One can skip executing the tests
as well.

# Running Tests

Expand All @@ -98,6 +105,12 @@ mvn test -DexcludedGroups= -Dgroups=flaky,slow
mvn test '-Dgroups=!slow'
```

```bash
./gradlew test
./gradlew test -DexcludeTags= -DincludeTags=flaky,slow
./gradlew test '-DincludeTags=!slow'
```

Please note that some tests may fail as sites change and our rippers become out of date.
Start by building and testing a released version of RipMe
and then ensure that any changes you make do not cause more tests to break.
100 changes: 100 additions & 0 deletions build.gradle.kts
@@ -0,0 +1,100 @@
plugins {
id("fr.brouillard.oss.gradle.jgitver") version "0.9.1"
id("jacoco")
id("java")
id("maven-publish")
}

repositories {
mavenLocal()
mavenCentral()
}

dependencies {
implementation("org.java-websocket:Java-WebSocket:1.5.1")
implementation("org.jsoup:jsoup:1.8.1")
implementation("org.json:json:20190722")
implementation("commons-configuration:commons-configuration:1.7")
implementation("log4j:log4j:1.2.17")
implementation("commons-cli:commons-cli:1.2")
implementation("commons-io:commons-io:1.3.2")
implementation("org.apache.httpcomponents:httpclient:4.3.6")
implementation("org.apache.httpcomponents:httpmime:4.3.3")
implementation("org.graalvm.js:js:20.1.0")
testImplementation(enforcedPlatform("org.junit:junit-bom:5.6.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("junit:junit:4.13")
}

group = "com.rarchives.ripme"
version = "1.7.94"
description = "ripme"

jgitver {
gitCommitIDLength = 8
nonQualifierBranches = "main,master"
useGitCommitID = true
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<Jar> {
manifest {
attributes["Main-Class"] = "com.rarchives.ripme.App"
}

// To add all of the dependencies otherwise a "NoClassDefFoundError" error
from(sourceSets.main.get().output)

dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}

tasks.test {
useJUnitPlatform {
// gradle-6.5.1 not yet allows passing this as parameter, so exclude it
excludeTags("flaky","slow")
includeEngines("junit-jupiter")
includeEngines("junit-vintage")
}
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}

tasks.register<Test>("testAll") {
useJUnitPlatform {
includeTags("flaky","slow")
}
}

// make all archive tasks in the build reproducible
tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}

tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
reports {
xml.isEnabled = false
csv.isEnabled = false
html.destination = file("${buildDir}/jacocoHtml")
}
}

Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 6c4fff0

Please sign in to comment.