class CmakeServerExternalNativeJsonGenerator extends CmakeExternalNativeJsonGenerator {

    @NonNull
    @Override
    List<String> getCacheArguments(@NonNull JsonGenerationAbiConfiguration abiConfig) {
        List<String> cacheArguments = getCommonCacheArguments(abiConfig);
        cacheArguments.add("-DCMAKE_SYSTEM_NAME=Android");
        cacheArguments.add(String.format("-DCMAKE_ANDROID_ARCH_ABI=%s", abiConfig.getAbiName()));
        cacheArguments.add(
                String.format("-DCMAKE_SYSTEM_VERSION=%s", abiConfig.getAbiPlatformVersion()));
        // Generates the compile_commands json file that will help us get the compiler executable
        // and flags.
        cacheArguments.add("-DCMAKE_EXPORT_COMPILE_COMMANDS=ON");
        cacheArguments.add(String.format("-DCMAKE_ANDROID_NDK=%s", getNdkFolder()));

        cacheArguments.add(
                String.format(
                        "-DCMAKE_TOOLCHAIN_FILE=%s",
                        getToolchainFile(abiConfig.getAbiName()).getAbsolutePath()));

        // By default, use the ninja generator.
        cacheArguments.add("-G Ninja");

        // To preserve backward compatibility with fork CMake look for ninja.exe next to cmake.exe
        // and use it. If it's not there then normal CMake search logic will be used.
        File possibleNinja =
                isWindows()
                        ? new File(getCmakeBinFolder(), "ninja.exe")
                        : new File(getCmakeBinFolder(), "ninja");
        if (possibleNinja.isFile()) {
            cacheArguments.add(String.format("-DCMAKE_MAKE_PROGRAM=%s", possibleNinja));
        }
        return cacheArguments;
    }

    public  CmakeServerExternalNativeJsonGenerator(
            @NonNull JsonGenerationVariantConfiguration config,
            @NonNull Set<String> configurationFailures,
            @NonNull AndroidBuilder androidBuilder,
            @NonNull File cmakeFolder,
            @NonNull GradleBuildVariant.Builder stats);

}