Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor build script. #528

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 15 additions & 40 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- created

env:
JAVA_VERSION: '11'
JAVA_VERSION: '17'
JAVA_DISTRIBUTION: 'microsoft'

jobs:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Test
run: ./gradlew check

shadow_jar:
build:
needs: test
runs-on: ubuntu-latest
steps:
Expand All @@ -39,13 +39,13 @@ jobs:
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Build JAR
run: ./gradlew shadowJar
- name: Persist JAR Artifact
- name: Build
run: ./gradlew build
- name: Persist JAR Artifacts
uses: actions/upload-artifact@v3
with:
name: jar
path: build/libs/stellar-sdk.jar
name: libs
path: build/libs/*.jar

javadoc:
needs: test
Expand All @@ -66,27 +66,8 @@ jobs:
name: javadoc
path: javadoc

javadoc_jar:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Generate javadocJar
run: ./gradlew javadocJar
- name: Persist javadocJar
uses: actions/upload-artifact@v3
with:
name: javadoc_jar
path: build/libs/stellar-sdk-javadoc.jar

android-test:
needs: shadow_jar
needs: build
runs-on: macos-13
name: android-test (api ${{ matrix.emulator.api-level }})
strategy:
Expand All @@ -96,19 +77,19 @@ jobs:
# TODO: Investigate why it is unstable on API 33.
emulator: [
{ api-level: 26, target: google_apis },
{ api-level: 33, target: playstore }
{ api-level: 32, target: playstore }
]
steps:
- name: checkout
uses: actions/checkout@v3
- name: Download JAR Artifact
uses: actions/download-artifact@v2
with:
name: jar
name: libs
path: android_test/app/libs/
- uses: actions/setup-java@v3
with:
java-version: 17 # TODO: Android Gradle plugin requires Java 11, consider replacing other parts with Java 17.
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
Expand All @@ -121,7 +102,7 @@ jobs:
profile: 'pixel_2'

deploy:
needs: [ javadoc, shadow_jar, javadoc_jar ] # TODO: add android-test when it is stable.
needs: [ build, javadoc ] # TODO: add android-test when it is stable.
permissions:
contents: write
if: github.event_name == 'release' && github.event.action == 'created'
Expand All @@ -132,26 +113,20 @@ jobs:
- name: Download JAR Artifact
uses: actions/download-artifact@v2
with:
name: jar
path: jar
name: libs
path: libs
- name: Download Java Documentation
uses: actions/download-artifact@v2
with:
name: javadoc
path: javadoc
- name: Download javadocJar
uses: actions/download-artifact@v2
with:
name: javadoc_jar
path: javadoc_jar
- name: Archive Documentation
run: tar -czf stellar-sdk-javadoc.tar.gz javadoc
- name: Upload artifacts to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
jar/stellar-sdk.jar
javadoc_jar/stellar-sdk-javadoc.jar
libs/*.jar
stellar-sdk-javadoc.tar.gz
- name: Upload Documentation to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ As this project is pre 1.0, breaking changes may happen for minor version bumps.
## 0.41.0-beta.4
* Add support for Soroban Preview 11. ([#530](https://github.com/stellar/java-stellar-sdk/pull/530))
* Bump dependencies & Remove unnecessary dependencies. ([#523](https://github.com/stellar/java-stellar-sdk/pull/523))
* No longer provide a shadow jar that has relocated third-party dependencies, but instead default to providing a thin jar.
We also offer an [uber jar](https://docs.gradle.org/current/userguide/working_with_files.html#sec:creating_uber_jar_example) and javadoc jar.
You can import the jar you need in one of the following three ways: ([#528](https://github.com/stellar/java-stellar-sdk/issues/528))
```kotlin
implementation("com.github.stellar:java-stellar-sdk:{version}") // thin jar
implementation("com.github.stellar:java-stellar-sdk:{version}:uber") // uber jar
implementation("com.github.stellar:java-stellar-sdk:{version}:javadoc") // javadoc jar
```
* Use JDK 17 for CI builds. ([#528](https://github.com/stellar/java-stellar-sdk/issues/528))

## 0.41.0-beta.3
* Fix the bug in Transaction.isSorobanTransaction to accommodate BumpFootprintExpirationOperation. ([#518](https://github.com/stellar/java-stellar-sdk/pull/518))
Expand Down
8 changes: 8 additions & 0 deletions android_test/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ dependencies {
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation(files("libs/stellar-sdk.jar"))
// Since we are adding local jar(libs/stellar-sdk.jar) as dependency,
// gradle cannot automatically download the required third-party dependencies.
implementation("com.squareup.okhttp3:okhttp:4.11.0")
implementation("com.squareup.okhttp3:okhttp-sse:4.11.0")
implementation("com.moandjiezana.toml:toml4j:0.7.2")
implementation("com.google.code.gson:gson:2.10.1")
implementation("net.i2p.crypto:eddsa:0.3.0")
implementation("commons-codec:commons-codec:1.16.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.3.0-alpha03")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
Expand Down
119 changes: 0 additions & 119 deletions build.gradle

This file was deleted.

Loading