Skip to content

Commit

Permalink
Reuse library version definition from pillarbox-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 committed Jun 20, 2024
1 parent 03ee04a commit 84bf863
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 45 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand All @@ -45,8 +43,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -74,8 +70,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -103,8 +97,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -132,8 +124,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -183,8 +173,6 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/dependency_graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: should_run
name: Check that the last commit was made in the last 24h
if: ${{ github.event_name == 'schedule' }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if pre release tag
id: check-tag
run: |
Expand Down
29 changes: 4 additions & 25 deletions pillarbox-player/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* License information is available from the LICENSE file.
*/

import java.io.ByteArrayOutputStream

plugins {
alias(libs.plugins.pillarbox.android.library)
alias(libs.plugins.pillarbox.android.library.publishing)
Expand All @@ -13,21 +11,12 @@ plugins {
}

android {
buildFeatures {
buildConfig = true
defaultConfig {
buildConfigField("String", "VERSION_NAME", "\"${version}\"")
}

buildTypes {
debug {
buildConfigField("String", "VERSION_NAME", "\"debug\"")
}

release {
val latestTagHash = execCommand("git", "rev-list", "--tags", "--max-count=1")
val versionName = execCommand("git", "describe", "--tags", "$latestTagHash")

buildConfigField("String", "VERSION_NAME", "\"${versionName}\"")
}
buildFeatures {
buildConfig = true
}

// Mockk includes some licenses information, which may conflict with other license files. This block merges all licenses together.
Expand Down Expand Up @@ -80,13 +69,3 @@ dependencies {
androidTestRuntimeOnly(libs.kotlinx.coroutines.android)
androidTestImplementation(libs.mockk)
}

private fun execCommand(vararg commandSegments: String): String {
return ByteArrayOutputStream().use { stream ->
exec {
commandLine = commandSegments.toList()
standardOutput = stream
}
stream.toString(Charsets.UTF_8).trim()
}
}

0 comments on commit 84bf863

Please sign in to comment.