Skip to content

Commit

Permalink
refactor: Change build structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Owain94 committed Nov 30, 2019
1 parent 1208274 commit de17e55
Show file tree
Hide file tree
Showing 65 changed files with 4,685 additions and 1,272 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: OpenOSRS - CI (PR)

on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']

jobs:
pr-lint:
name: PR title
runs-on: ubuntu-latest

steps:
- name: PR title lint
if: github.event_name == 'pull_request'
uses: seferov/[email protected]
with:
title-regex: '^([\w-/]+): \w+'

build:
runs-on: ubuntu-latest
name: Build

steps:
- name: Download java
run: wget -O jdk-8u221-linux-x64.tar.gz -c --content-disposition "https://javadl.oracle.com/webapps/download/AutoDL?BundleId=239835_230deb18db3e4014bb8e3e8324f81b43"

- name: Set up JDK 8
uses: actions/setup-java@master
with:
java-version: 1.8
architecture: x64
jdkFile: ./jdk-8u221-linux-x64.tar.gz

- uses: actions/checkout@v1

- uses: actions/checkout@v1
with:
repository: open-osrs/runelite
ref: master

- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Make gradlew executable (client)
run: chmod +x ./gradlew
working-directory: /home/runner/work/plugins/runelite

- name: Assembling client
run: ./gradlew assemble --console=plain
working-directory: /home/runner/work/plugins/runelite

- name: Building client
run: ./gradlew build --stacktrace -x test -x checkstyleMain --console=plain
working-directory: /home/runner/work/plugins/runelite

- name: Upload client artifacts to local maven
run: ./gradlew publishToMavenLocal --console=plain
working-directory: /home/runner/work/plugins/runelite

- name: Make gradlew executable (plugins)
run: chmod +x ./gradlew

- name: Assembling plugins
run: ./gradlew assemble --console=plain

- name: Checking plugins code conventions (Test)
run: ./gradlew checkstyleTest --console=plain

- name: Checking plugins code conventions (Main)
run: ./gradlew checkstyleMain --console=plain

- name: Building plugins
run: ./gradlew build --stacktrace -x test -x checkstyleMain --console=plain

- name: Testing plugins
run: ./gradlew test --stacktrace --console=plain
57 changes: 57 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: OpenOSRS - CI (Push)

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
name: Build

steps:
- name: Download java
run: wget -O jdk-8u221-linux-x64.tar.gz -c --content-disposition "https://javadl.oracle.com/webapps/download/AutoDL?BundleId=239835_230deb18db3e4014bb8e3e8324f81b43"

- name: Set up JDK 8
uses: actions/setup-java@master
with:
java-version: 1.8
architecture: x64
jdkFile: ./jdk-8u221-linux-x64.tar.gz

- uses: actions/checkout@v1

- uses: actions/checkout@v1
with:
repository: open-osrs/runelite
ref: master

- name: Make gradlew executable (client)
run: chmod +x ./gradlew
working-directory: /home/runner/work/plugins/runelite

- name: Assembling client
run: ./gradlew assemble --console=plain
working-directory: /home/runner/work/plugins/runelite

- name: Building client
run: ./gradlew build --stacktrace -x test -x checkstyleMain --console=plain
working-directory: /home/runner/work/plugins/runelite

- name: Upload client artifacts to local maven
run: ./gradlew publishToMavenLocal --console=plain
working-directory: /home/runner/work/plugins/runelite

- name: Make gradlew executable (plugins)
run: chmod +x ./gradlew

- name: Assembling plugins
run: ./gradlew assemble --console=plain

- name: Building plugins
run: ./gradlew build --stacktrace -x test -x checkstyleMain --console=plain

- name: Testing plugins
run: ./gradlew test --stacktrace --console=plain
Binary file removed OPRS-BUILD/http-api-1.5.42.jar
Binary file not shown.
Binary file removed OPRS-BUILD/runelite-api-1.5.42.jar
Binary file not shown.
Binary file removed OPRS-BUILD/runelite-client-1.5.42.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ subprojects {
repositories {
jcenter()
mavenLocal()
flatDir {
dirs("../OPRS-BUILD/", "./OPRS-BUILD/")
}
maven(url = "https://repo.runelite.net")
maven(url = "https://jitpack.io")
}

apply<JavaLibraryPlugin>()
Expand Down
8 changes: 3 additions & 5 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ object ProjectVersions {
const val launcherVersion = "2.0.4"
const val rlVersion = "1.5.42"

const val openosrsVersion = "2.1.12.0-SNAPSHOT"
const val openosrsVersion = "2.1.15.0"

const val rsversion = 185
const val rsversion = 186
const val cacheversion = 165
}

Expand All @@ -40,7 +40,7 @@ object Plugins {
val testLogger = Pair("com.adarshr.test-logger", "2.0.0")
val versions = Pair("com.github.ben-manes.versions", "0.27.0")
val latestVersion = Pair("se.patrikerdes.use-latest-versions", "0.2.13")
val grgit = Pair("org.ajoberstar.grgit", "4.0.0-rc.1")
val grgit = Pair("org.ajoberstar.grgit", "4.0.0")
val jarTest = Pair("com.github.hauner.jarTest", "1.0.1")
val shadow = Pair("com.github.johnrengelman.shadow", "5.2.0")
}
Expand All @@ -49,7 +49,6 @@ object Libraries {
private object Versions {
const val annotations = "18.0.0"
const val antlr = "4.7.2"
const val apacheCommonsLang = "3.9"
const val apacheCommonsCompress = "1.19"
const val apacheCommonsCsv = "1.7"
const val apacheCommonsText = "1.8"
Expand Down Expand Up @@ -104,7 +103,6 @@ object Libraries {

const val annotations = "org.jetbrains:annotations:${Versions.annotations}"
const val antlr = "org.antlr:antlr4-runtime:${Versions.antlr}"
const val apacheCommonsLang = "org.apache.commons:commons-lang3:${Versions.apacheCommonsLang}"
const val apacheCommonsCompress = "org.apache.commons:commons-compress:${Versions.apacheCommonsCompress}"
const val apacheCommonsCsv = "org.apache.commons:commons-csv:${Versions.apacheCommonsCsv}"
const val apacheCommonsText = "org.apache.commons:commons-text:${Versions.apacheCommonsText}"
Expand Down
21 changes: 14 additions & 7 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="SuppressionCommentFilter"/>
<module name="LeftCurly">
<property name="option" value="nl"/>
<!-- allow {} on anonymous classes and lambdas-->
<property name="tokens" value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF, STATIC_INIT"/>
</module>
<module name="RightCurly">
<property name="option" value="alone"/>
Expand All @@ -42,12 +44,12 @@
<property name="message" value="Indent must use tab characters"/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="import (?!static|java\.awt).*\*"/>
<property name="message" value="Multiline imports are disallowed if they are not static"/>
<property name="ignoreComments" value="true"/>
<module name="AvoidStarImport">
<property name="allowStaticMemberImports" value="true"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyTypes" value="true"/>
</module>
<module name="WhitespaceAround"/>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA"/>
</module>
Expand All @@ -57,6 +59,11 @@
<property name="format" value="else[ \t]*[\r\n]+[ \t]*if"/>
<property name="message" value="Newline should not be between else and if"/>
</module>
<module name="RegexpMultiline">
<property name="format" value="^[\r\n\s]+import"/>
<property name="maximum" value="1"/>
<property name="message" value="There should not be empty lines in the imports list"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>
Expand Down
4 changes: 2 additions & 2 deletions config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<suppress files="RuntimeTypeAdapterFactory\.java" checks="[a-zA-Z0-9]*"/>
<suppress files="[\\/]ScriptVarType[\./]" checks="[a-zA-Z0-9]*"/>
Expand Down
18 changes: 9 additions & 9 deletions gpu/gpu.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,19 @@ dependencies {

compileOnly("com.openosrs:runelite-api:$rlVersion")
compileOnly("com.openosrs:runelite-client:$rlVersion")

compileOnly(Libraries.guice)
compileOnly(Libraries.javax)
compileOnly(Libraries.lombok)
compileOnly(Libraries.rxjava)
compileOnly(Libraries.pf4j)
compileOnly(Libraries.jogampJogl)
compileOnly(Libraries.jogampGluegen)
compileOnly(Libraries.jogampGluegenLinuxAmd64)
compileOnly(Libraries.jogampGluegenLinuxI586)
compileOnly(Libraries.jogampGluegenWindowsAmd64)
compileOnly(Libraries.jogampGluegenWindowsI586)
compileOnly(Libraries.jogampJoglLinuxAmd64)
compileOnly(Libraries.jogampJoglLinuxI586)
compileOnly(Libraries.jogampJoglWindowsAmd64)
compileOnly(Libraries.jogampJoglWindowsI586)

testImplementation(Libraries.jogampJogl)
testImplementation(Libraries.jogampGluegen)
testImplementation(Libraries.junit)
testImplementation(Libraries.hamcrest)
}

tasks {
Expand All @@ -61,7 +59,9 @@ tasks {
"Plugin-Id" to "gpu-plugin",
"Plugin-Class" to "net.runelite.client.plugins.gpu.GpuPluginWrapper",
"Plugin-Provider" to "OpenOSRS",
"Plugin-Dependencies" to ""
"Plugin-Dependencies" to "",
"Plugin-Description" to "Utilizes the GPU",
"Plugin-License" to "3-Clause BSD License"
))
}

Expand Down
9 changes: 5 additions & 4 deletions gpu/src/main/java/net/runelite/client/plugins/gpu/GLUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import lombok.extern.slf4j.Slf4j;

@Slf4j
public
class GLUtil
{
private static final int ERR_LEN = 1024;
Expand Down Expand Up @@ -137,8 +138,8 @@ static void glDeleteRenderbuffers(GL4 gl, int renderBuffer)
gl.glDeleteRenderbuffers(1, buf, 0);
}

static void loadShaders(GL4 gl, int glProgram, int glVertexShader, int glGeometryShader, int glFragmentShader,
String vertexShaderStr, String geomShaderStr, String fragShaderStr) throws ShaderException
public static void loadShaders(GL4 gl, int glProgram, int glVertexShader, int glGeometryShader, int glFragmentShader,
String vertexShaderStr, String geomShaderStr, String fragShaderStr) throws ShaderException
{
compileAndAttach(gl, glProgram, glVertexShader, vertexShaderStr);

Expand Down Expand Up @@ -166,7 +167,7 @@ static void loadShaders(GL4 gl, int glProgram, int glVertexShader, int glGeometr
}
}

static void loadComputeShader(GL4 gl, int glProgram, int glComputeShader, String str) throws ShaderException
public static void loadComputeShader(GL4 gl, int glProgram, int glComputeShader, String str) throws ShaderException
{
compileAndAttach(gl, glProgram, glComputeShader, str);

Expand Down Expand Up @@ -204,7 +205,7 @@ private static void compileAndAttach(GL4 gl, int program, int shader, String sou
}
}

static String inputStreamToString(InputStream in)
public static String inputStreamToString(InputStream in)
{
Scanner scanner = new Scanner(in).useDelimiter("\\A");
return scanner.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ class GpuFloatBuffer
{
private FloatBuffer buffer = allocateDirect(65536);

static FloatBuffer allocateDirect(int size)
{
return ByteBuffer.allocateDirect(size * Float.BYTES)
.order(ByteOrder.nativeOrder())
.asFloatBuffer();
}

void put(float texture, float u, float v)
{
buffer.put(texture).put(u).put(v).put((float) 0.0);
Expand Down Expand Up @@ -69,4 +62,11 @@ FloatBuffer getBuffer()
{
return buffer;
}

static FloatBuffer allocateDirect(int size)
{
return ByteBuffer.allocateDirect(size * Float.BYTES)
.order(ByteOrder.nativeOrder())
.asFloatBuffer();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ class GpuIntBuffer
{
private IntBuffer buffer = allocateDirect(65536);

static IntBuffer allocateDirect(int size)
{
return ByteBuffer.allocateDirect(size * Integer.BYTES)
.order(ByteOrder.nativeOrder())
.asIntBuffer();
}

void put(int x, int y, int z, int c)
{
buffer.put(x).put(y).put(z).put(c);
Expand Down Expand Up @@ -69,4 +62,11 @@ IntBuffer getBuffer()
{
return buffer;
}

static IntBuffer allocateDirect(int size)
{
return ByteBuffer.allocateDirect(size * Integer.BYTES)
.order(ByteOrder.nativeOrder())
.asIntBuffer();
}
}
Loading

0 comments on commit de17e55

Please sign in to comment.