Method: Pindo::CommonConfuseProj#update_symash_config

Defined in:
lib/pindo/module/build/commonconfuseproj.rb

#update_symash_config(app_config_dir: nil, project_path: nil, confuse_type: nil, force_config: nil) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/pindo/module/build/commonconfuseproj.rb', line 57

def update_symash_config(app_config_dir:nil, project_path:nil, confuse_type:nil, force_config: nil)

    if File.exist?(File.join(project_path, "Symash.json"))
        proj_config_json= JSON.parse(File.read(File.join(project_path, "Symash.json")))
        proj_config_json['BACKEND_SYMASH_DISABLE_SPL'] = true

        if File.exist?(File.join(app_config_dir, "Symash.json"))
        
            app_config_json=JSON.parse(File.read(File.join(app_config_dir, "Symash.json")))
            proj_config_json = init_hash_value_wihtout_exludekeys(hash1:proj_config_json, hash2:app_config_json, exlude_keys:['VERSION','IMPORT', 'FASTPORT', 'STRICT', 'FASTPORT','IGNORE_SYMASH_MAINPROJ', 'ENABLE_BACKEND_SYMASH', 'ENABLE_BACKEND_SYMASH2', 'CONFUSE_VERSION'])

        end

        unless force_config.nil?
            proj_config_json = init_hash_value_wihtout_exludekeys(hash1:proj_config_json, hash2:force_config, exlude_keys:[])
        end

        File.open(File.join(project_path, "Symash.json"), "w") do |f|
            f.write(JSON.pretty_generate(proj_config_json))
        end

    end
end