Esempio n. 1
0
 def _configure(self, context):
     if not os.path.exists(self.build_path):
         shutil.copytree(self.source_path,
                         self.build_path,
                         symlinks=True)
     try:
         shutil.rmtree(pj(self.build_path, 'kiwixlib', 'src', 'main'))
     except FileNotFoundError:
         pass
     for arch in option('android_arch'):
         try:
             kiwix_builder = get_target_step('kiwix-lib',
                                             'android_{}'.format(arch))
         except KeyError:
             pass
         else:
             copy_tree(
                 pj(kiwix_builder.buildEnv.install_dir, 'kiwix-lib'),
                 pj(self.build_path, 'kiwixlib', 'src', 'main'))
     os.makedirs(pj(self.build_path, 'app', 'src', 'main', 'assets',
                    'icu'),
                 exist_ok=True)
     for arch in option('android_arch'):
         try:
             kiwix_builder = get_target_step('kiwix-lib',
                                             'android_{}'.format(arch))
         except KeyError:
             pass
         else:
             shutil.copy2(
                 pj(kiwix_builder.buildEnv.install_dir, 'share', 'icu',
                    '58.2', 'icudt58l.dat'),
                 pj(self.build_path, 'app', 'src', 'main', 'assets',
                    'icu', 'icudt58l.dat'))
             break
Esempio n. 2
0
 def _install(self, context):
     copy_tree(
         pj(self.source_path, "bin"),
         pj(self.install_path, "bin"),
         post_copy_function = add_execution_right)
     copy_tree(
         pj(self.source_path, "lib"),
         pj(self.install_path, "lib"))
Esempio n. 3
0
 def _configure(self, context):
     try:
         shutil.rmtree(self.build_path)
     except FileNotFoundError:
         pass
     if not os.path.exists(self.build_path):
         shutil.copytree(pj(self.source_path, 'android-kiwix-lib-publisher'), self.build_path, symlinks=True)
     for arch in option('android_arch'):
         try:
             kiwix_builder = get_target_step('kiwix-lib', 'android_{}'.format(arch))
         except KeyError:
             pass
         else:
             copy_tree(pj(kiwix_builder.buildEnv.install_dir, 'kiwix-lib'),
                       pj(self.build_path, 'kiwixLibAndroid', 'src', 'main'))
Esempio n. 4
0
        def _configure(self, context):
            # Copy kiwix-android in build dir.
            kiwix_android_source = get_target_step('kiwix-android', 'source')
            if not os.path.exists(self.build_path):
                shutil.copytree(kiwix_android_source.source_path, self.build_path)

            # Copy kiwix-lib application in build dir
            try:
                shutil.rmtree(pj(self.build_path, 'kiwixlib', 'src', 'main'))
            except FileNotFoundError:
                pass
            for arch in option('android_arch'):
                try:
                    kiwix_builder = get_target_step('kiwix-lib', 'android_{}'.format(arch))
                except KeyError:
                    pass
                else:
                    copy_tree(pj(kiwix_builder.buildEnv.install_dir, 'kiwix-lib'),
                              pj(self.build_path, 'kiwixlib', 'src', 'main'))
            os.makedirs(
                pj(self.build_path, 'app', 'src', 'main', 'assets', 'icu'),
                exist_ok=True)
            for arch in option('android_arch'):
                try:
                    kiwix_builder = get_target_step('kiwix-lib', 'android_{}'.format(arch))
                except KeyError:
                    pass
                else:
                    shutil.copy2(pj(kiwix_builder.buildEnv.install_dir, 'share', 'icu', '58.2',
                                    'icudt58l.dat'),
                                 pj(self.build_path, 'app', 'src', 'main', 'assets',
                                    'icu', 'icudt58l.dat'))
                    break
            # Generate custom directory
            try:
                shutil.rmtree(pj(self.build_path, 'custom'))
            except FileNotFoundError:
                pass
            os.makedirs(pj(self.build_path, 'custom'))
            command = "./gen-custom-android-directory.py {custom_name} --output-dir {custom_dir}"
            command = command.format(
                custom_name=option('android_custom_app'),
                custom_dir=pj(self.build_path, 'custom', option('android_custom_app'))
            )
            run_command(command, self.source_path, context, buildEnv=self.buildEnv)
Esempio n. 5
0
 def _copy_headers(self, context):
     plt = PlatformInfo.get_platform('iOS_{}'.format(
         option('ios_arch')[0]))
     include_src = pj(plt.buildEnv.install_dir, 'include')
     include_dst = pj(self.buildEnv.install_dir, 'include')
     copy_tree(include_src, include_dst)