Skip to content

Commit d12176f

Browse files
authored
Update project structure, added iterable (MinecraftTAS#1)
It's finally time to update my good old friend BigArrayList In TASmod, I use BAL to store the inputs... And as you do, you often have to iterate over the list. However, the following notation never worked: ```java BigArrayList<InputContainer> inputs = new BigArrayList<>(); // fill inputs for(InputContainer container : inputs) { // do stuff } ``` As BAL is not implementing iterable... And I thought like: "Sure, BAL can't do that since collections store their index in int and BAL stores it in long..." - No wrong, that's not how iterators work, I never looked it up... This [change](https://github.com/MinecraftTAS/BigArrayList/pull/1/files#diff-126438686ad82b7fbc523207a604b5ad0affaee8799cbe7af86bdf4580bd3cacR1060) took me 5 minutes and I would've saved me a lot of pain in TASmod ._.
2 parents 7a0d4ee + 4e755ec commit d12176f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+478
-5206
lines changed

.github/workflows/publish-main.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Publish Main to https://maven.minecrafttas.com/main
2+
name: Publish Main
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'MinecraftTAS/BigArrayList'
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK 23 for x64
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: '23'
18+
distribution: 'temurin'
19+
architecture: x64
20+
- name: Setup Gradle
21+
uses: gradle/actions/setup-gradle@v3
22+
with:
23+
gradle-version: 8.13
24+
- name: Publish
25+
run: gradle publishAllPublicationsToMinecrafttasMainRepository -Prelease=true -PminecrafttasMainUsername=${{ secrets.MAVEN_NAME }} -PminecrafttasMainPassword=${{ secrets.MAVEN_SECRET }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Publish snapshot to https://maven.minecrafttas.com/snapshots
2+
name: Publish Snapshot
3+
4+
on: [push]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
if: github.repository == 'MinecraftTAS/BigArrayList'
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up JDK 23 for x64
13+
uses: actions/setup-java@v4
14+
with:
15+
java-version: '23'
16+
distribution: 'temurin'
17+
architecture: x64
18+
- name: Setup Gradle
19+
uses: gradle/actions/setup-gradle@v3
20+
with:
21+
gradle-version: 8.13
22+
- name: Publish
23+
run: gradle publishAllPublicationsToMinecrafttasSnapshotsRepository -PminecrafttasSnapshotsUsername=${{ secrets.MAVEN_NAME }} -PminecrafttasSnapshotsPassword=${{ secrets.MAVEN_SECRET }}

.github/workflows/report.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: report
2+
run-name: Upload Test Report
3+
on:
4+
workflow_run:
5+
workflows: [test]
6+
types: [completed]
7+
8+
permissions:
9+
contents: read
10+
actions: read
11+
checks: write
12+
jobs:
13+
report:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: dorny/[email protected]
17+
with:
18+
artifact: TestResult
19+
name: Tests
20+
path: '*.xml'
21+
reporter: java-junit

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK 23 for x64
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: '23'
18+
distribution: 'temurin'
19+
architecture: x64
20+
- name: Setup Gradle
21+
uses: gradle/actions/setup-gradle@v4
22+
with:
23+
gradle-version: 8.13
24+
- name: Build
25+
run: gradle build
26+
- name: Upload Test Report
27+
uses: actions/upload-artifact@v4
28+
if: always()
29+
with:
30+
name: TestResult
31+
path: build/test-results/test/*.xml
32+
retention-days: 1

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bin
2+
.gradle/
3+
.settings
4+
.classpath
5+
.project
6+
.metadata
7+
.factorypath
8+
9+
build/
10+
bin/
11+
memory/

BigArrayList-1.4.jar

-17.7 KB
Binary file not shown.

build.gradle

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,54 @@
11

22
plugins {
33
id 'java'
4-
id 'idea'
4+
id 'java-gradle-plugin'
5+
id 'maven-publish'
56
}
67

8+
def snapshot = project.release=="true" ? "" : "-SNAPSHOT"
9+
version = project.version+snapshot
10+
group="com.dselent"
11+
12+
sourceCompatibility = targetCompatibility = 8
13+
714
repositories {
815
mavenCentral()
916
}
1017

11-
test {
12-
useJUnitPlatform()
13-
}
14-
1518
dependencies {
16-
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.9.3'
19+
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.3'
20+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
1721
}
1822

23+
test {
24+
useJUnitPlatform()
25+
testLogging {
26+
events "passed", "skipped", "failed"
27+
}
28+
}
1929

30+
java {
31+
withSourcesJar()
32+
withJavadocJar()
33+
}
2034

21-
22-
35+
publishing {
36+
repositories {
37+
maven {
38+
name = "minecrafttasSnapshots"
39+
url = "https://maven.minecrafttas.com/snapshots"
40+
credentials(PasswordCredentials)
41+
authentication {
42+
basic(BasicAuthentication)
43+
}
44+
}
45+
maven {
46+
name = "minecrafttasMain"
47+
url = "https://maven.minecrafttas.com/main"
48+
credentials(PasswordCredentials)
49+
authentication {
50+
basic(BasicAuthentication)
51+
}
52+
}
53+
}
54+
}

doc/allclasses-frame.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

doc/allclasses-noframe.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)