# frozen_string_literal: true

require File.expand_path('../config.rb', __FILE__)

source "https://rubygems.org"

# core gems

no_fat_gem = [:ruby]
gem "rake"
gem "bundler", BUNDLER_VERSION
gem "cool.io", "1.8.1",  platforms: no_fat_gem
gem "sigdump", "0.2.5"
gem "http_parser.rb", "0.8.0"
gem "yajl-ruby", "1.4.3"
gem "serverengine", '2.3.2'
gem "msgpack", "1.7.2"
gem "oj", "3.16.4"
gem "tzinfo", "2.0.6"
gem "tzinfo-data", "1.2024.1"
gem "async", "1.32.1"
# async-http 0.65.0 or later does not support async 1.x
gem "async-http", "0.64.2"
gem "webrick", "1.8.1"

if ENV["INSTALL_GEM_FROM_LOCAL_REPO"]
  # During build process, pre-built fluentd gem will be installed
  # from this local repository, this way is used to avoid embedding full-path
  # into managed Gemfile.lock
  source FLUENTD_LOCAL_GEM_REPO do
    gem "fluentd"
    # Bundle forked version of win32-service until
    # https://github.com/chef/win32-service/pull/85 is merged.
    # This workaround should be applied to fluent-package not to block starting
    # fluentdwinsvc service on Windows. See
    # https://github.com/fluent/fluent-package-builder/issues/618
    # NOTE: platforms: does not work in source ... do block
    gem "win32-service" if RUBY_PLATFORM =~ /mswin|mingw/
  end
else
  # Lock to specific revision
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
  gem "fluentd", github: "fluent/fluentd", ref: FLUENTD_REVISION
  gem "win32-service", github: "fluent-plugins-nursery/win32-service", branch: "fluent-package", platforms: [:mingw, :x64_mingw]
end

# plugin gems

gem "elasticsearch", "8.14.0"
gem "fluent-plugin-elasticsearch", "5.4.3"
gem "ruby-kafka", "1.5.0"
gem "digest-murmurhash", "1.1.1"
gem "fluent-plugin-kafka", "0.19.3"
# f-p-prometheus_pushgateway doesn't support prometheus 3.0 or later
gem "prometheus-client", "2.1.0"
gem "fluent-plugin-prometheus", "2.1.0"
gem "fluent-plugin-prometheus_pushgateway", "0.1.1"
gem "jmespath", "1.6.2"
gem "aws-partitions", "1.957.0"
gem "aws-sdk-core", "3.201.2"
gem "aws-sdk-kms", "1.88.0"
gem "aws-sdk-sqs", "1.80.0"
gem "aws-sigv4", "1.8.0"
gem "aws-sdk-s3", "1.156.0"
gem "fluent-plugin-s3", "1.7.2"
gem "httpclient", "2.8.3"
gem "fluent-diagtool", "1.0.5"
# td doesn't support td-client 2.0.0 or later yet
gem "td", "0.17.1"
gem "td-client", "1.0.8"
gem "fluent-plugin-td", "1.2.0"
gem "webhdfs", "0.11.0"
gem "fluent-plugin-webhdfs", "1.6.0"
gem "fluent-plugin-record-modifier", "2.2.0"
gem "fluent-plugin-rewrite-tag-filter", "2.4.0"
gem "fluent-plugin-sd-dns", "0.1.0"
gem "fluent-plugin-flowcounter-simple", "0.1.0"
gem "mini_portile2", "2.8.7"
gem "cmetrics", "0.3.3"
gem "fluent-plugin-metrics-cmetrics", "0.1.2"
gem "fluent-plugin-calyptia-monitoring", "0.1.3"
gem "opensearch-ruby", "3.4.0"
gem "fluent-plugin-opensearch", "1.1.4"

windows_platforms = [:mingw, :x64_mingw] # :mswin
gem "ffi", "1.17.0", platforms: windows_platforms
gem "ffi-win32-extensions", "1.0.4", platforms: windows_platforms
gem "nokogiri", "1.16.7", platforms: windows_platforms
gem "win32-event", "0.6.3", platforms: windows_platforms
gem "win32-ipc", "0.7.0", platforms: windows_platforms
# Use officially released version when PR was merged and released.
#gem "win32-service", "2.3.2", platforms: windows_platforms
gem "winevt_c", "0.11.0", platforms: windows_platforms
gem "win32-eventlog", "0.6.7", platforms: windows_platforms
gem "fluent-plugin-parser-winevt_xml", "0.2.7", platforms: windows_platforms
gem "fluent-plugin-windows-eventlog", "0.9.0", platforms: windows_platforms
gem "fluent-plugin-windows-exporter", "1.0.0", platforms: windows_platforms

not_windows_platforms = [:ruby]
gem "rdkafka", "0.16.1", platforms: not_windows_platforms
gem "systemd-journal", "1.4.2", platforms: not_windows_platforms
gem "fluent-plugin-systemd", "1.0.5", platforms: not_windows_platforms
gem "fluent-plugin-utmpx", "0.5.0", platforms: not_windows_platforms
