buildscript { repositories { mavenCentral() }}

plugins {
  id "com.diffplug.spotless" version "5.14.0"
}

spotless {
    lineEndings 'UNIX'

    java {
        target 'spine-libgdx/**/*.java',
               'spine-android/**/*.java'
        eclipse().configFile('formatters/eclipse-formatter.xml')
    }

    cpp {
        target 'spine-c/**/*.c',
               'spine-c/**/.h',
               'spine-cpp/**/*.cpp',
               'spine-cpp/**/.h',
               'spine-cocos2dx/src/**/*.cpp',
               'spine-cocos2dx/src/**/*.h',
               'spine-cocos2dx/example/Classes/**/*.cpp',
               'spine-cocos2dx/example/Classes/**/*.h',
               'spine-glfw/src/**/*.cpp',
               'spine-glfw/src/**/*.h',
               'spine-glfw/example/**/*.cpp',
               'spine-glfw/example/**/*.h',
               'spine-sdl/src/**/*.c',
               'spine-sdl/src/**/*.cpp',
               'spine-sdl/src/**/*.h',
               'spine-sdl/example/**/*.c',
               'spine-sdl/example/**/*.cpp',
               'spine-sdl/example/**/*.h',
               'spine-sfml/c/src/**/*.c',
               'spine-sfml/c/src/**/*.h',
               'spine-sfml/cpp/src/**/*.cpp',
               'spine-sfml/cpp/src/**/*.h',
               'spine-ue/**/*.cpp',
               'spine-ue/**/*.h',
               'spine-godot/spine_godot/*.cpp',
               'spine-godot/spine_godot/*.h'
        clangFormat("13.0.1").pathToExe("$System.env.CLANGFORMAT").style('file')
    }

    typescript {
        target 'spine-ts/**/src/*.ts'
        targetExclude 'spine-ts/**/*.d.ts', 'spine-ts/**/node_modules/**/*.ts'
        tsfmt('7.2.2').tsfmtFile('formatters/tsfmt.json')
    }
}