Skip to content

Commit

Permalink
Change: バージョン周りを共通化
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Sep 15, 2023
1 parent 81283e7 commit 5db3d3d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
13 changes: 5 additions & 8 deletions crates/voicevox_core_java_api/lib/build-android.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ plugins {
id 'org.jetbrains.kotlin.android' version '1.9.10'
}

def String cargoToml = file('../../../Cargo.toml').text
def String cargoTomlVersion = (cargoToml =~ /(?m)^version = "(\S+)"$/)[0][1]

version = cargoTomlVersion
version = gradle.ext.version

repositories {
google()
Expand All @@ -20,15 +17,15 @@ dependencies {
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
implementation group: 'com.google.code.gson', name: 'gson', version: gradle.ext.gsonVersion

// https://mvnrepository.com/artifact/jakarta.validation/jakarta.validation-api
implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: '3.0.2'
implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: gradle.ext.jakartaValidationVersion

// https://mvnrepository.com/artifact/jakarta.annotation/jakarta.annotation-api
implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '2.1.1'
implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: gradle.ext.jakartaAnnotationVersion

implementation group: 'com.microsoft.onnxruntime', name: 'onnxruntime-android', version: '1.14.0'
implementation group: 'com.microsoft.onnxruntime', name: 'onnxruntime-android', version: gradle.ext.onnxruntimeVersion
}

// Apply a specific Java toolchain to ease working on different environments.
Expand Down
15 changes: 2 additions & 13 deletions crates/voicevox_core_java_api/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ def String cargoTomlVersion = (cargoToml =~ /(?m)^version = "(\S+)"$/)[0][1]
def String device = System.getenv('DEVICE')?.toLowerCase() ?: "cpu"
def boolean isGpu = ['cuda', 'directml'].contains(device)

version = cargoTomlVersion

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
Expand All @@ -30,19 +28,10 @@ dependencies {

testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'

// https://mvnrepository.com/artifact/jakarta.validation/jakarta.validation-api
implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: '3.0.2'

// https://mvnrepository.com/artifact/jakarta.annotation/jakarta.annotation-api
implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '2.1.1'

if (isGpu) {
implementation group: 'com.microsoft.onnxruntime', name: 'onnxruntime_gpu', version: '1.14.0'
implementation group: 'com.microsoft.onnxruntime', name: 'onnxruntime_gpu', version: gradle.ext.onnxruntimeVersion
} else {
implementation group: 'com.microsoft.onnxruntime', name: 'onnxruntime', version: '1.14.0'
implementation group: 'com.microsoft.onnxruntime', name: 'onnxruntime', version: gradle.ext.onnxruntimeVersion
}
}

Expand Down
12 changes: 12 additions & 0 deletions crates/voicevox_core_java_api/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ if (isAndroid) {
} else {
project(':lib').buildFileName = 'build.gradle'
}

def String cargoToml = file('../../Cargo.toml').text
def String cargoTomlVersion = (cargoToml =~ /(?m)^version = "(\S+)"$/)[0][1]

gradle.ext {
version = cargoTomlVersion

gsonVersion = '2.10.1'
jakartaValidationVersion = '3.0.2'
jakartaAnnotationVersion = '2.1.1'
onnxruntimeVersion = '1.14.0'
}

0 comments on commit 5db3d3d

Please sign in to comment.