rootProject.name = 'marginalia'

include 'code:services-core:index-service'
include 'code:services-core:assistant-service'
include 'code:services-core:control-service'
include 'code:services-core:query-service'
include 'code:services-core:executor-service'
include 'code:services-core:single-service-runner'

include 'code:services-application:search-service'
include 'code:services-application:search-service-legacy'
include 'code:services-application:api-service'
include 'code:services-application:dating-service'
include 'code:services-application:explorer-service'
include 'code:services-application:status-service'

include 'code:functions:math'
include 'code:functions:math:api'
include 'code:functions:favicon'
include 'code:functions:favicon:api'
include 'code:functions:domain-info'
include 'code:functions:domain-info:api'
include 'code:functions:nsfw-domain-filter'

include 'code:functions:link-graph:partition'
include 'code:functions:link-graph:aggregate'
include 'code:functions:link-graph:api'

include 'code:functions:search-query'
include 'code:functions:search-query:api'

include 'code:functions:live-capture'
include 'code:functions:live-capture:api'

include 'code:execution'
include 'code:execution:api'

include 'code:index'
include 'code:index:api'
include 'code:index:index-journal'
include 'code:index:query'
include 'code:index:index-forward'
include 'code:index:index-reverse'

include 'code:libraries:array'
include 'code:libraries:array:cpp'
include 'code:libraries:coded-sequence'
include 'code:libraries:geo-ip'
include 'code:libraries:btree'
include 'code:libraries:easy-lsh'
include 'code:libraries:guarded-regex'
include 'code:libraries:random-write-funnel'
include 'code:libraries:blocking-thread-pool'
include 'code:libraries:braille-block-punch-cards'
include 'code:libraries:language-processing'
include 'code:libraries:term-frequency-dict'
include 'code:libraries:test-helpers'

include 'code:libraries:message-queue'

include 'code:features-search:screenshots'
include 'code:features-search:random-websites'

include 'code:processes:converting-process:ft-anchor-keywords'

include 'code:processes:crawling-process:ft-crawl-blocklist'
include 'code:processes:crawling-process:ft-link-parser'
include 'code:processes:crawling-process:ft-content-type'
include 'code:processes:live-crawling-process'

include 'code:processes:process-mq-api'

include 'code:common:db'
include 'code:common:linkdb'
include 'code:common:service'
include 'code:common:config'
include 'code:common:model'
include 'code:common:renderer'

include 'code:processes:converting-process'
include 'code:processes:converting-process:model'
include 'code:processes:converting-process:ft-keyword-extraction'

include 'code:processes:crawling-process'
include 'code:processes:crawling-process:model'

include 'code:processes:loading-process'
include 'code:processes:index-constructor-process'
include 'code:processes:test-data'

include 'code:processes:export-task-process'

include 'code:tools:experiment-runner'
include 'code:tools:screenshot-capture-tool'
include 'code:tools:load-test'
include 'code:tools:integration-test'
include 'code:tools:browserless'

include 'third-party:porterstemmer'
include 'third-party:symspell'
include 'third-party:rdrpostagger'
include 'third-party:openzim'
include 'third-party:count-min-sketch'
include 'third-party:commons-codec'
include 'third-party:parquet-floor'
include 'third-party:rssreader'
include 'third-party:encyclopedia-marginalia-nu'

ext {
    joobyVersion = '3.5.5'
}

dependencyResolutionManagement {

    repositories {
        mavenLocal()
        maven { url "https://artifactory.cronapp.io/public-release/" }
        maven { url "https://repo1.maven.org/maven2/" }
        maven { url "https://www2.ph.ed.ac.uk/maven2/" }
        maven { url "https://jitpack.io/" }
        maven { url "https://artifacts.marginalia.nu/snapshots" }

        exclusiveContent {
            forRepository {
                maven {
                    url = uri("https://jitpack.io")
                }
            }
            filter {
                // Only use JitPack for the `gson-record-type-adapter-factory` library
                includeModule("com.github.Marcono1234", "gson-record-type-adapter-factory")
            }
        }

        exclusiveContent {
            forRepository {
                maven {
                    url = uri("https://artifacts.marginalia.nu/snapshots")
                }
            }
            filter {
                // Only use the Marginalia snapshot repository for the `slop` library
                includeModule("nu.marginalia", "slop")
            }
        }
    }

    versionCatalogs {
        libs {
            library('mariadb-client', 'org.mariadb.jdbc', 'mariadb-java-client').version('3.0.6')
            library('hikaricp', 'com.zaxxer:HikariCP:5.0.1')

            library('spark', 'com.sparkjava', 'spark-core').version('2.9.4')
            library('guice', 'com.google.inject', 'guice').version('7.0.0')
            library('guava', 'com.google.guava', 'guava').version('32.0.1-jre')
            library('protobuf', 'com.google.protobuf', 'protobuf-java').version('3.16.3')
            library('grpc-protobuf', 'io.grpc', 'grpc-protobuf').version('1.73.0')
            library('grpc-stub', 'io.grpc', 'grpc-stub').version('1.73.0')
            library('grpc-netty', 'io.grpc', 'grpc-netty-shaded').version('1.73.0')

            library('prometheus', 'io.prometheus', 'simpleclient').version('0.16.0')
            library('prometheus-servlet', 'io.prometheus', 'simpleclient_servlet').version('0.16.0')
            library('prometheus-server', 'io.prometheus', 'simpleclient_httpserver').version('0.16.0')
            library('prometheus-hotspot', 'io.prometheus', 'simpleclient_hotspot').version('0.16.0')

            library('slf4j.api', 'org.slf4j', 'slf4j-api').version('2.0.3')
            library('slf4j.jdk14', 'org.slf4j', 'slf4j-jdk14').version('2.0.3')

            library('log4j.api', 'org.apache.logging.log4j', 'log4j-api').version('2.24.3')
            library('log4j.core', 'org.apache.logging.log4j', 'log4j-core').version('2.24.3')
            library('log4j.slf4j', 'org.apache.logging.log4j', 'log4j-slf4j2-impl').version('2.24.3')

            library('notnull','org.jetbrains','annotations').version('24.0.0')

            library('trove', 'net.sf.trove4j', 'trove4j').version('3.0.3')
            library('fastutil', 'it.unimi.dsi', 'fastutil').version('8.5.8')

            library('hll', 'net.agkn', 'hll').version('1.6.0')
            library('duckdb', 'org.duckdb', 'duckdb_jdbc').version('0.9.1')
            library('okhttp3','com.squareup.okhttp3','okhttp').version('4.11.0')

            library('jwarc', 'org.netpreserve', 'jwarc').version('0.28.5')


            library('httpcore', 'org.apache.httpcomponents.core5','httpcore5').version('5.3.4')
            library('httpclient', 'org.apache.httpcomponents.client5','httpclient5').version('5.4.3')
            library('commons.net', 'commons-net','commons-net').version('3.9.0')
            library('commons.lang3', 'org.apache.commons','commons-lang3').version('3.12.0')
            library('commons.compress','org.apache.commons','commons-compress').version('1.25.0')
            library('commons.io','commons-io','commons-io').version('2.11.0')
            library('commons.codec', 'commons-codec', 'commons-codec').version('1.16.0')

            library('ffi','com.github.jnr','jnr-ffi').version('2.2.12')
            library('databind','com.fasterxml.jackson.core','jackson-databind').version('2.13.5')

            library('crawlercommons', 'com.github.crawler-commons', 'crawler-commons').version('1.3')

            library('stanford.corenlp','edu.stanford.nlp','stanford-corenlp').version('4.5.5')
            library('opennlp','org.apache.opennlp','opennlp-tools').version('2.3.3')
            library('fasttext','com.github.vinhkhuc','jfasttext').version('0.5')
            library('roaringbitmap','org.roaringbitmap','RoaringBitmap').version('0.9.32')
            library('opencsv','com.opencsv','opencsv').version('5.9')
            library('bucket4j','com.github.vladimir-bukhtoyarov','bucket4j-core').version('7.5.0')

            library('gson','com.google.code.gson','gson').version('2.10.1')
            library('gson-type-adapter','com.github.Marcono1234','gson-record-type-adapter-factory').version('0.3.0')

            library('zstd','com.github.luben','zstd-jni').version('1.5.2-2')
            library('lz4','org.lz4','lz4-java').version('1.8.0')
            library('xz','org.tukaani','xz').version('1.9')

            library('flyway.core','org.flywaydb','flyway-core').version('10.4.1')
            library('flyway.mysql','org.flywaydb','flyway-mysql').version('10.4.1')

            library('jsoup','org.jsoup','jsoup').version('1.15.3')
            library('snakeyaml','org.yaml','snakeyaml').version('1.33') // Known CVE, but this library only parses internal config files so it's fine

            library('junit.jupiter','org.junit.jupiter','junit-jupiter-api').version('5.8.2')
            library('junit.jupiter.engine','org.junit.jupiter','junit-jupiter-engine').version('')
            library('mockito','org.mockito','mockito-junit-jupiter').version('4.5.1')

            library('selenium.chrome','org.seleniumhq.selenium','selenium-chrome-driver').version('4.8.3')
            library('selenium.java','org.seleniumhq.selenium','selenium-java').version('4.8.3')

            library('handlebars','com.github.jknack','handlebars').version('4.3.1')
            library('handlebars.markdown','com.github.jknack','handlebars-markdown').version('4.2.1')

            library('sqlite','org.xerial','sqlite-jdbc').version('3.41.2.2')
            library('javax.annotation','javax.annotation','javax.annotation-api').version('1.3.2')

            library('parquet-column', 'org.apache.parquet','parquet-column').version('1.14.0')
            library('parquet-hadoop', 'org.apache.parquet','parquet-hadoop').version('1.14.0')

            library('curator-framework', 'org.apache.curator','curator-framework').version('5.6.0')
            library('curator-x-discovery', 'org.apache.curator','curator-x-discovery').version('5.6.0')

            library('jetty-server','org.eclipse.jetty','jetty-server').version('9.4.54.v20240208')
            library('jetty-util','org.eclipse.jetty','jetty-util').version('9.4.54.v20240208')
            library('jetty-servlet','org.eclipse.jetty','jetty-servlet').version('9.4.54.v20240208')

            library('slop', 'nu.marginalia', 'slop').version('0.0.11-SNAPSHOT')
            library('jooby-netty','io.jooby','jooby-netty').version(joobyVersion)
            library('jooby-jte','io.jooby','jooby-jte').version(joobyVersion)
            library('jooby-apt','io.jooby','jooby-apt').version(joobyVersion)

            library('wiremock', 'org.wiremock','wiremock').version('3.11.0')
            library('jte','gg.jte','jte').version('3.1.15')

            library('pdfbox', 'org.apache.pdfbox', 'pdfbox').version('3.0.5')
            bundle('jetty', ['jetty-server', 'jetty-util', 'jetty-servlet'])

            bundle('slf4j', ['slf4j.api', 'log4j.api', 'log4j.core', 'log4j.slf4j'])
            bundle('slf4j.test', ['slf4j.jdk14'])
            bundle('prometheus', ['prometheus', 'prometheus-servlet', 'prometheus-server', 'prometheus-hotspot'])
            bundle('mariadb', ['mariadb-client', 'hikaricp'])
            bundle('nlp', ['stanford.corenlp', 'opennlp', 'fasttext'])
            bundle('selenium', ['selenium.chrome', 'selenium.java'])
            bundle('handlebars', ['handlebars', 'handlebars.markdown'])
            bundle('grpc', ['protobuf', 'grpc-stub', 'grpc-protobuf', 'grpc-netty'])
            bundle('protobuf', ['protobuf', 'javax.annotation'])
            bundle('gson', ['gson', 'gson-type-adapter'])
            bundle('httpcomponents', ['httpcore', 'httpclient'])
            bundle('parquet', ['parquet-column', 'parquet-hadoop'])
            bundle('junit', ['junit.jupiter', 'junit.jupiter.engine'])
            bundle('flyway', ['flyway.core', 'flyway.mysql'])
            bundle('jooby', ['jooby-netty', 'jooby-jte'])
            bundle('curator', ['curator-framework', 'curator-x-discovery'])

        }
    }
}
