dev.nokee.platform.cpp.internal.DefaultCppLibraryExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platformNative Show documentation
Show all versions of platformNative Show documentation
Painless native development in Gradle
The newest version!
package dev.nokee.platform.cpp.internal;
import dev.nokee.language.cpp.internal.CppSourceSet;
import dev.nokee.platform.base.VariantView;
import dev.nokee.platform.cpp.CppLibraryExtension;
import dev.nokee.platform.nativebase.NativeLibrary;
import dev.nokee.platform.nativebase.NativeLibraryDependencies;
import dev.nokee.platform.nativebase.internal.BaseNativeExtension;
import dev.nokee.platform.nativebase.internal.DefaultNativeLibraryComponent;
import org.gradle.api.Action;
import org.gradle.api.Project;
import javax.inject.Inject;
public abstract class DefaultCppLibraryExtension extends BaseNativeExtension implements CppLibraryExtension {
@Inject
public DefaultCppLibraryExtension(DefaultNativeLibraryComponent component) {
super(component);
getComponent().getSourceCollection().add(getObjects().newInstance(CppSourceSet.class).srcDir("src/main/cpp"));
}
@Override
public NativeLibraryDependencies getDependencies() {
return getComponent().getDependencies();
}
@Override
public void dependencies(Action super NativeLibraryDependencies> action) {
getComponent().dependencies(action);
}
public void finalizeExtension(Project project) {
getComponent().finalizeExtension(project);
}
@Override
public VariantView getVariants() {
return getComponent().getVariantCollection().getAsView(NativeLibrary.class);
}
}