Esempio n. 1
0
def main():
    rm = ResourceManager('notreepunching', resource_dir='../src/main/resources')
    rm_vanilla = ResourceManager(resource_dir='../src/main/resources')
    clean_generated_resources('../src/main/resources')

    assets.generate(rm)
    assets.generate_vanilla(rm_vanilla)
    recipes.generate(rm)
    recipes.generate_vanilla(rm_vanilla)

    rm.flush()
    rm_vanilla.flush()
def main():
    rm = ResourceManager('betterfoliage', resource_dir='../src/main/resources')

    generate_all(rm)
    print(
        'New = %d, Modified = %d, Unchanged = %d, Errors = %d' %
        (rm.new_files, rm.modified_files, rm.unchanged_files, rm.error_files))
def main():
    parser = argparse.ArgumentParser(description='Generate resources for TFC')
    parser.add_argument('--clean',
                        action='store_true',
                        dest='clean',
                        help='Clean all auto generated resources')
    parser.add_argument(
        '--hotswap',
        type=str,
        default=None,
        help=
        'A secondary target directory to write resources to, creates a resource hotswap.'
    )
    args = parser.parse_args()

    rm = ResourceManager('tfc', resource_dir='../src/main/resources')

    if args.clean:
        # Stupid windows file locking errors.
        for tries in range(1, 1 + 3):
            try:
                utils.clean_generated_resources('/'.join(rm.resource_dir))
                print('Clean Success')
                return
            except:
                print('Failed, retrying (%d / 3)' % tries)
        print('Clean Aborted')
        return

    generate_all(rm)
    print(
        'New = %d, Modified = %d, Unchanged = %d, Errors = %d' %
        (rm.new_files, rm.modified_files, rm.unchanged_files, rm.error_files))

    if args.hotswap is not None:
        # Optionally generate all resources into a second directory (the build dir, either gradle or IDEA's, for resource hot swapping
        rm = ResourceManager('tfc', resource_dir=args.hotswap)
        generate_all(rm)
        print('Hotswap Finished')
Esempio n. 4
0
def main():
    parser = argparse.ArgumentParser(
        description='Generate resources for Survivalism')
    parser.add_argument('--clean',
                        action='store_true',
                        dest='clean',
                        help='Clean all auto generated resources')
    parser.add_argument(
        '--hotswap',
        action='store_true',
        dest='hotswap',
        help=
        'Also generate resources into the /out/production/resources directory, creates an asset hotswap'
    )
    args = parser.parse_args()

    rm = ResourceManager('survivalism', resource_dir='../src/main/resources')
    if args.clean:
        # Stupid windows file locking errors.
        for tries in range(1, 1 + 3):
            try:
                clean_generated_resources('/'.join(rm.resource_dir))
                print('Clean Success')
                return
            except Exception:
                print('Failed, retrying (%d / 3)' % tries)
        print('Clean Aborted')
        return

    generate_all(rm)
    print(
        'New = %d, Modified = %d, Unchanged = %d, Errors = %d' %
        (rm.new_files, rm.modified_files, rm.unchanged_files, rm.error_files))

    if args.hotswap:
        # Generate into the /out/production/resources folder, which is used when build + run with Intellij
        rm = ResourceManager('tfc', resource_dir='../out/production/resources')
        generate_all(rm)
        print('Hotswap Finished')