Skip to content

Commit

Permalink
Fix: 依存関係を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Sep 16, 2023
1 parent 5db3d3d commit a50ecbd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 11 additions & 4 deletions crates/voicevox_core_java_api/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ plugins {
id "com.diffplug.spotless" version "6.20.0"
}

def String cargoToml = file('../../../Cargo.toml').text
def String cargoTomlVersion = (cargoToml =~ /(?m)^version = "(\S+)"$/)[0][1]
def boolean isGpu = ['cuda', 'directml'].contains(gradle.ext.device)

def String device = System.getenv('DEVICE')?.toLowerCase() ?: "cpu"
def boolean isGpu = ['cuda', 'directml'].contains(device)
version = gradle.ext.version

repositories {
// Use Maven Central for resolving dependencies.
Expand All @@ -28,6 +26,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: gradle.ext.gsonVersion

// https://mvnrepository.com/artifact/jakarta.validation/jakarta.validation-api
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: gradle.ext.jakartaAnnotationVersion

if (isGpu) {
implementation group: 'com.microsoft.onnxruntime', name: 'onnxruntime_gpu', version: gradle.ext.onnxruntimeVersion
} else {
Expand Down
3 changes: 3 additions & 0 deletions crates/voicevox_core_java_api/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def String cargoTomlVersion = (cargoToml =~ /(?m)^version = "(\S+)"$/)[0][1]
gradle.ext {
version = cargoTomlVersion

targetOs = targetOs
targetDevice = System.getenv('DEVICE') ?: 'cpu'

gsonVersion = '2.10.1'
jakartaValidationVersion = '3.0.2'
jakartaAnnotationVersion = '2.1.1'
Expand Down

0 comments on commit a50ecbd

Please sign in to comment.