All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.nokee.platform.cpp.internal.DefaultCppLibraryExtension Maven / Gradle / Ivy

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 action) {
		getComponent().dependencies(action);
	}

	public void finalizeExtension(Project project) {
		getComponent().finalizeExtension(project);
	}

	@Override
	public VariantView getVariants() {
		return getComponent().getVariantCollection().getAsView(NativeLibrary.class);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy