/ tests / java / build.gradle.kts
build.gradle.kts
 1  /*
 2   * Copyright 2025 Alibaba Group Holding Ltd.
 3   *
 4   * Licensed under the Apache License, Version 2.0 (the "License");
 5   * you may not use this file except in compliance with the License.
 6   * You may obtain a copy of the License at
 7   *
 8   *     http://www.apache.org/licenses/LICENSE-2.0
 9   *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  plugins {
18      java
19      alias(libs.plugins.spotless)
20  }
21  
22  group = "com.alibaba.opensandbox"
23  version = "1.0.0"
24  
25  java {
26      sourceCompatibility = JavaVersion.VERSION_17
27      targetCompatibility = JavaVersion.VERSION_17
28  }
29  
30  repositories {
31      mavenLocal()
32      exclusiveContent {
33          forRepository {
34              mavenLocal()
35          }
36          filter {
37              includeGroup("com.alibaba.opensandbox")
38          }
39      }
40      mavenCentral()
41  }
42  
43  configurations.configureEach {
44      resolutionStrategy.cacheDynamicVersionsFor(0, "seconds")
45      resolutionStrategy.cacheChangingModulesFor(0, "seconds")
46  }
47  
48  dependencies {
49      // OpenSandbox Kotlin SDKs
50      testImplementation("com.alibaba.opensandbox:sandbox:latest.integration")
51      testImplementation("com.alibaba.opensandbox:code-interpreter:latest.integration")
52  
53      // Test frameworks
54      testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
55      testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.13.4")
56  }
57  
58  tasks.withType<Test> {
59      useJUnitPlatform()
60  }
61  
62  tasks.register<Test>("e2eTest") {
63      description = "Runs end-to-end tests."
64      group = "verification"
65  
66      useJUnitPlatform {
67          includeTags("e2e")
68      }
69  }
70  
71  spotless {
72      java {
73          googleJavaFormat("1.19.2").aosp()
74          removeUnusedImports()
75          trimTrailingWhitespace()
76          endWithNewline()
77      }
78  }