feat: compile reqwest4j instead of using binary

This commit is contained in:
DarkCat09 2025-02-18 22:34:36 +04:00
parent 246738cbc3
commit 931caf99a1
Signed by: DarkCat09
GPG key ID: BD3CE9B65916CD82
2 changed files with 27 additions and 1 deletions

View file

@ -1,10 +1,30 @@
FROM eclipse-temurin:21-jdk-noble AS build
RUN apt update && apt install -y git curl gcc && rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
ENV PATH="/root/.cargo/bin:$PATH"
WORKDIR /r4j
RUN git clone --single-branch --depth 1 https://github.com/TeamPiped/reqwest4j.git ./
RUN sed -E -i \
-e 's/command\.set\("cross"\)/command.set("cargo")/' \
-e '/targets \+= target/d' \
-e '/command\.set\("cargo"\)/a targets += defaultTarget()' \
reqwest-jni/build.gradle.kts
RUN ./gradlew shadowJar
RUN find build/libs -name 'reqwest4j-*.jar' -exec mv {} /r4j/lib.jar \;
WORKDIR /app
RUN apt update && apt install -y git && rm -rf /var/lib/apt/lists/*
RUN git clone --single-branch --depth 1 https://github.com/TeamPiped/Piped-Backend.git ./
RUN sed -i \
-e "s#implementation 'rocks.kavin:reqwest4j:.*'#implementation files('/r4j/lib.jar')#" \
build.gradle
RUN ./gradlew shadowJar
RUN sh -c 'echo "$(git log -1 --date=short --pretty=format:%cd)-$(git rev-parse --short HEAD)" >VERSION'

View file

@ -1,4 +1,10 @@
services:
# piped-build-dbg:
# image: piped-build-dbg
# build:
# context: .
# dockerfile: Dockerfile.piped
# target: build
piped:
image: git.dc09.ru/darkcat09/piped
build: