blob: 4035dac6134b0b29beea2bd35fb9a0cad9d9852e [file] [log] [blame]
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.build.buildInfo
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency
import org.junit.Test
import androidx.build.buildInfo.CreateLibraryBuildInfoFileTask.Companion.asBuildInfoDependencies
import net.saff.checkmark.Checkmark.Companion.check
class CreateLibraryBuildInfoFileTaskTest {
@Test
fun buildInfoDependencies() {
val deps: List<ModuleDependency> =
listOf(DefaultExternalModuleDependency("androidx.group", "artifact", "version"))
deps.asBuildInfoDependencies().single().check { it.groupId == "androidx.group" }
.check { it.artifactId == "artifact" }.check { it.version == "version" }
.check { !it.isTipOfTree }
}
@Test
fun suffix() {
computeTaskSuffix("cubane").check { it == "" }
computeTaskSuffix("cubane-jvm").check { it == "Jvm" }
computeTaskSuffix("cubane-jvm-linux-x64").check { it == "JvmLinuxX64" }
}
}