<commit_before>#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

Domgen::Generator.define([:imit],
                         "#{File.dirname(__FILE__)}/templates",
                         [Domgen::Java::Helper]) do |g|
  g.template_set(:imit_metadata) do |template_set|
    template_set.erb_template(:repository,
                              'shared/graph_enum.java.erb',
                              'main/java/#{repository.imit.qualified_graph_enum_name.gsub(".","/")}.java')
  end

  g.template_set(:imit_client_entity) do |template_set|
    template_set.erb_template(:entity,
                              'client/entity.java.erb',
                              'main/java/#{entity.imit.qualified_name.gsub(".","/")}.java')
    template_set.erb_template(:data_module,
                              'client/mapper.java.erb',
                              'main/java/#{data_module.imit.qualified_mapper_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/change_mapper.java.erb',
                              'main/java/#{repository.imit.qualified_change_mapper_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/router_impl.java.erb',
                              'main/java/#{repository.imit.qualified_client_router_impl_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/router_interface.java.erb',
                              'main/java/#{repository.imit.qualified_client_router_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/repository_debugger.java.erb',
                              'main/java/#{repository.imit.qualified_repository_debugger_name.gsub(".","/")}.java')
  end

  g.template_set(:imit_client_entity_gwt_module) do |template_set|
    template_set.erb_template(:repository,
                              'client/replicant_module.xml.erb',
                              'main/resources/#{repository.imit.qualified_replicant_module_name.gsub(".","/")}.gwt.xml')
  end

  g.template_set(:imit_client_entity_gwt) do |template_set|
    template_set.erb_template(:repository,
                              'client/gwt/gwt_data_loader_service_interface.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_data_loader_service_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/gwt/session_interface.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_client_session_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/gwt/session.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_client_session_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/gwt/session_context.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_client_session_context_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/gwt/gwt_data_loader_service.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_data_loader_service_name.gsub(".","/")}.java')
  end

  g.template_set(:imit_client_entity_ee) do |template_set|
    template_set.erb_template(:repository,
                              'client/ee/session_interface.java.erb',
                              'main/java/#{repository.imit.qualified_ee_client_session_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/ee/session.java.erb',
                              'main/java/#{repository.imit.qualified_ee_client_session_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/ee/ee_data_loader_service_interface.java.erb',
                              'main/java/#{repository.imit.qualified_ee_data_loader_service_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/ee/session_context.java.erb',
                              'main/java/#{repository.imit.qualified_ee_client_session_context_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/ee/abstract_ee_data_loader_service.java.erb',
                              'main/java/#{repository.imit.qualified_abstract_ee_data_loader_service_name.gsub(".","/")}.java',
                              :additional_helpers => [Domgen::Jws::Helper])
  end

  g.template_set(:imit_client_service) do |template_set|
    template_set.erb_template(:service,
                              'client/service.java.erb',
                              'main/java/#{service.imit.qualified_name.gsub(".","/")}.java')
    template_set.erb_template(:service,
                              'client/proxy.java.erb',
                              'main/java/#{service.imit.qualified_proxy_name.gsub(".","/")}.java',
                              :additional_facets => [:gwt_rpc])
    template_set.erb_template(:repository,
                              'client/gwt/services_module.java.erb',
                              'main/java/#{repository.imit.qualified_services_module_name.gsub(".","/")}.java',
                              :additional_facets => [:gwt_rpc])
    template_set.erb_template(:exception,
                              'client/exception.java.erb',
                              'main/java/#{exception.imit.qualified_name.gsub(".","/")}.java')
  end

  %w(main test).each do |type|
    g.template_set(:"imit_server_#{type}_qa") do |template_set|
      template_set.erb_template(:repository,
                                'server/integration_module.java.erb',
                                'main/java/#{repository.imit.qualified_integration_module_name.gsub(".","/")}.java')
    end
    g.template_set(:"imit_client_#{type}_qa") do |template_set|
      template_set.erb_template(:data_module,
                                'client/abstract_test_factory.java.erb',
                                type + '/java/#{data_module.imit.qualified_abstract_test_factory_name.gsub(".","/")}.java')
      template_set.erb_template(:repository,
                                'client/test_factory_set.java.erb',
                                type + '/java/#{repository.imit.qualified_test_factory_set_name.gsub(".","/")}.java')
      template_set.erb_template(:repository,
                                'client/abstract_client_test.java.erb',
                                type + '/java/#{repository.imit.qualified_abstract_client_test_name.gsub(".","/")}.java')
      template_set.erb_template(:repository,
                                'client/client_test.java.erb',
                                type + '/java/#{repository.imit.qualified_client_test_name.gsub(".","/")}.java',
                                :guard => '!repository.imit.custom_client_test?')
    end

    g.template_set(:"imit_client_#{type}_gwt_qa") do |template_set|
      template_set.erb_template(:repository,
                                'client/gwt/abstract_gwt_client_test.java.erb',
                                type + '/java/#{repository.imit.qualified_abstract_gwt_client_test_name.gsub(".","/")}.java',<commit_msg>Rename tempalte_sets to follow conventions where external test artifacts are separated from app internal artifacts<commit_after>#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

Domgen::Generator.define([:imit],
                         "#{File.dirname(__FILE__)}/templates",
                         [Domgen::Java::Helper]) do |g|
  g.template_set(:imit_metadata) do |template_set|
    template_set.erb_template(:repository,
                              'shared/graph_enum.java.erb',
                              'main/java/#{repository.imit.qualified_graph_enum_name.gsub(".","/")}.java')
  end

  g.template_set(:imit_client_entity) do |template_set|
    template_set.erb_template(:entity,
                              'client/entity.java.erb',
                              'main/java/#{entity.imit.qualified_name.gsub(".","/")}.java')
    template_set.erb_template(:data_module,
                              'client/mapper.java.erb',
                              'main/java/#{data_module.imit.qualified_mapper_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/change_mapper.java.erb',
                              'main/java/#{repository.imit.qualified_change_mapper_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/router_impl.java.erb',
                              'main/java/#{repository.imit.qualified_client_router_impl_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/router_interface.java.erb',
                              'main/java/#{repository.imit.qualified_client_router_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/repository_debugger.java.erb',
                              'main/java/#{repository.imit.qualified_repository_debugger_name.gsub(".","/")}.java')
  end

  g.template_set(:imit_client_entity_gwt_module) do |template_set|
    template_set.erb_template(:repository,
                              'client/replicant_module.xml.erb',
                              'main/resources/#{repository.imit.qualified_replicant_module_name.gsub(".","/")}.gwt.xml')
  end

  g.template_set(:imit_client_entity_gwt) do |template_set|
    template_set.erb_template(:repository,
                              'client/gwt/gwt_data_loader_service_interface.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_data_loader_service_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/gwt/session_interface.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_client_session_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/gwt/session.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_client_session_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/gwt/session_context.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_client_session_context_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/gwt/gwt_data_loader_service.java.erb',
                              'main/java/#{repository.imit.qualified_gwt_data_loader_service_name.gsub(".","/")}.java')
  end

  g.template_set(:imit_client_entity_ee) do |template_set|
    template_set.erb_template(:repository,
                              'client/ee/session_interface.java.erb',
                              'main/java/#{repository.imit.qualified_ee_client_session_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/ee/session.java.erb',
                              'main/java/#{repository.imit.qualified_ee_client_session_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/ee/ee_data_loader_service_interface.java.erb',
                              'main/java/#{repository.imit.qualified_ee_data_loader_service_interface_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/ee/session_context.java.erb',
                              'main/java/#{repository.imit.qualified_ee_client_session_context_name.gsub(".","/")}.java')
    template_set.erb_template(:repository,
                              'client/ee/abstract_ee_data_loader_service.java.erb',
                              'main/java/#{repository.imit.qualified_abstract_ee_data_loader_service_name.gsub(".","/")}.java',
                              :additional_helpers => [Domgen::Jws::Helper])
  end

  g.template_set(:imit_client_service) do |template_set|
    template_set.erb_template(:service,
                              'client/service.java.erb',
                              'main/java/#{service.imit.qualified_name.gsub(".","/")}.java')
    template_set.erb_template(:service,
                              'client/proxy.java.erb',
                              'main/java/#{service.imit.qualified_proxy_name.gsub(".","/")}.java',
                              :additional_facets => [:gwt_rpc])
    template_set.erb_template(:repository,
                              'client/gwt/services_module.java.erb',
                              'main/java/#{repository.imit.qualified_services_module_name.gsub(".","/")}.java',
                              :additional_facets => [:gwt_rpc])
    template_set.erb_template(:exception,
                              'client/exception.java.erb',
                              'main/java/#{exception.imit.qualified_name.gsub(".","/")}.java')
  end

  %w(main test).each do |type|
    g.template_set(:"imit_server_#{type}_qa") do |template_set|
      template_set.erb_template(:repository,
                                'server/integration_module.java.erb',
                                'main/java/#{repository.imit.qualified_integration_module_name.gsub(".","/")}.java')
    end
    g.template_set(:"imit_client_#{type}_qa_external") do |template_set|
      template_set.erb_template(:data_module,
                                'client/abstract_test_factory.java.erb',
                                type + '/java/#{data_module.imit.qualified_abstract_test_factory_name.gsub(".","/")}.java')
      template_set.erb_template(:repository,
                                'client/test_factory_set.java.erb',
                                type + '/java/#{repository.imit.qualified_test_factory_set_name.gsub(".","/")}.java')
      template_set.erb_template(:repository,
                                'client/abstract_client_test.java.erb',
                                type + '/java/#{repository.imit.qualified_abstract_client_test_name.gsub(".","/")}.java')
      template_set.erb_template(:repository,
                                'client/client_test.java.erb',
                                type + '/java/#{repository.imit.qualified_client_test_name.gsub(".","/")}.java',
                                :guard => '!repository.imit.custom_client_test?')
    end

    g.template_set(:"imit_client_#{type}_gwt_qa_external") do |template_set|
      template_set.erb_template(:repository,
                                'client/gwt/abstract_gwt_client_test.java.erb',
                                type + '/java/#{repository.imit.qualified_abstract_gwt_client_test_name.gsub(".","/")}.java',
{'fraction_non_alphanumeric': 0.13199925424150147, 'fraction_numerical': 0.0004971723323597041, 'mean_word_length': 2.0005593884020136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6173446', 'n_tokens_mistral': 4601, 'n_tokens_neox': 4495, 'n_words': 453}