示例#1
0
def main():
    common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))

    classpath = [
        common.fetch_maven('org.projectlombok', 'lombok', '1.18.18'),
        common.fetch_maven('org.jetbrains', 'annotations', '19.0.0')
    ]

    print('Generating', 'target/generated-sources/delombok/**.java')
    common.check_call([
        'java', '--class-path',
        common.classpath_separator.join(classpath), 'lombok.launch.Main',
        'delombok', 'src/main/java', '-d', 'target/generated-sources/delombok'
    ])

    print('Generating', '../docs/apidocs/**')
    sources = common.glob('target/generated-sources/delombok', '*.java')
    common.check_call([
        'javadoc', '--class-path',
        common.classpath_separator.join(classpath), '-d', '../docs/apidocs',
        '-quiet', '-Xdoclint:all,-missing'
    ] + sources)

    common.popd()
    return 0
示例#2
0
def main():
    common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))
    rev = revision.revision()
    print('Deploying skija-shared:' + rev)

    with open('pom.xml', 'r') as f:
        pom = f.read()

    with open('pom.xml', 'w') as f:
        f.write(pom.replace('0.0.0-SNAPSHOT', rev))

    common.check_call([
        'mvn.cmd' if common.system == 'windows' else 'mvn', '--batch-mode',
        '-DskipTests', 'lombok:delombok', 'javadoc:javadoc', 'javadoc:jar',
        'source:jar'
    ])

    common.check_call([
        'mvn.cmd' if common.system == 'windows' else 'mvn', '--batch-mode',
        '--settings', 'settings.xml', '-DskipTests',
        '-Dspace.username=Nikita.Prokopov',
        '-Dspace.password='******'SPACE_TOKEN'), 'deploy'
    ])

    with open('pom.xml', 'w') as f:
        f.write(pom)

    return 0
示例#3
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--dry-run', action='store_true')
    (args, _) = parser.parse_known_args()

    common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))
    rev = revision.revision()
    print('Deploying ' + common.skija_native_artifact_id + ':' + rev)

    with open(os.path.join('build', 'skija.version'), 'w') as f:
        f.write(rev)

    with open('pom.xml', 'r') as f:
        pom = f.read()

    with open('pom.xml', 'w') as f:
        f.write(
            pom.replace('0.0.0-SNAPSHOT',
                        rev).replace('skija-native',
                                     common.skija_native_artifact_id))

    if not args.dry_run:
        mvn = 'mvn.cmd' if common.system == 'windows' else 'mvn'
        common.check_call([
            mvn, '--batch-mode', '--settings', 'settings.xml',
            '-Dspace.username=Nikita.Prokopov',
            '-Dspace.password='******'SPACE_TOKEN'), 'deploy'
        ])

    with open('pom.xml', 'w') as f:
        f.write(pom)

    return 0
示例#4
0
def main():
    common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))
    shutil.rmtree('target', ignore_errors=True)
    shutil.rmtree("../docs/apidocs", ignore_errors=True)
    shutil.rmtree(os.path.join(os.path.expanduser('~'), '.m2', 'repository',
                               'org', 'jetbrains', 'skija', 'skija-shared',
                               '0.0.0-SNAPSHOT'),
                  ignore_errors=True)
    common.popd()
    return 0
示例#5
0
def main():
    common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))
    classpath = [
        common.fetch_maven('org.projectlombok', 'lombok', '1.18.18'),
        common.fetch_maven('org.jetbrains', 'annotations', '19.0.0')
    ]
    sources = common.glob('src/main/java', '*.java')
    common.javac(classpath, sources, 'target/classes')
    common.popd()
    return 0
示例#6
0
文件: build.py 项目: Mu-L/skija
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--debug', action='store_true')
    parser.add_argument('--arch', default=common.arch)
    parser.add_argument('--skia-dir')
    parser.add_argument('--skia-release', default='m92-f46c37ba85-2')
    (args, _) = parser.parse_known_args()

    build_type = 'Debug' if args.debug else 'Release'

    if args.skia_dir:
        skia_dir = os.path.abspath(args.skia_dir)
        common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))
    else:
        # Fetch Skia
        common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))
        skia_dir = "Skia-" + args.skia_release + "-" + common.system + "-" + build_type + '-' + common.arch
        if not os.path.exists(skia_dir):
            zip = skia_dir + '.zip'
            common.fetch(
                'https://github.com/JetBrains/skia-build/releases/download/' +
                args.skia_release + '/' + zip, zip)
            with zipfile.ZipFile(zip, 'r') as f:
                print("Extracting", zip)
                f.extractall(skia_dir)
            os.remove(zip)
        skia_dir = os.path.abspath(skia_dir)
    print("Using Skia from", skia_dir)

    # CMake
    os.makedirs("build", exist_ok=True)
    common.check_call([
        "cmake", "-G", "Ninja", "-DCMAKE_BUILD_TYPE=" + build_type,
        "-DSKIA_DIR=" + skia_dir, "-DSKIA_ARCH=" + common.arch
    ] + ([
        "-DCMAKE_OSX_ARCHITECTURES=" + {
            "x64": "x86_64",
            "arm64": "arm64"
        }[common.arch]
    ] if common.system == "macos" else []) + [".."],
                      cwd=os.path.abspath('build'))

    # Ninja
    common.check_call(["ninja"], cwd=os.path.abspath('build'))

    # icudtl
    icudtl_src = skia_dir + "/out/" + build_type + "-" + common.arch + "/icudtl.dat"
    icudtl_dst = "build/icudtl.dat"
    if os.path.exists(icudtl_src) and not os.path.exists(icudtl_dst):
        shutil.copy2(icudtl_src, icudtl_dst)

    common.popd()
    return 0
示例#7
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--skija-shared')
    parser.add_argument('--skija-native')
    (args, _) = parser.parse_known_args()

    if args.skija_shared:
        skija_shared = os.path.abspath(args.skija_shared)
    if args.skija_native:
        skija_native = os.path.abspath(args.skija_native)

    common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))

    if not args.skija_shared:
        skija_shared = 'target/classes'
    if not args.skija_native:
        skija_native = '../native/build'

    classpath = [
        common.fetch_maven('org.projectlombok', 'lombok', '1.18.16'),
        common.fetch_maven('org.jetbrains', 'annotations', '19.0.0'),
        skija_shared,
        skija_native,
    ]
    sources = common.glob('src/test/java', '*.java')
    common.javac(classpath, sources, 'target/test-classes')

    common.check_call([
        'java',
        '--class-path',
        common.classpath_separator.join(classpath + ['target/test-classes']),
        '-ea',
        '-esa',
        '-Xcheck:jni',
        'org.jetbrains.skija.TestSuite',
    ])

    common.popd()
    return 0
示例#8
0
def main():
  common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))
  rev = revision.revision()
  print('Packaging ' + common.skija_native_artifact_id + ':' + rev)

  with open(os.path.join('build', 'skija.version'), 'w') as f:
    f.write(rev)

  with open('pom.xml', 'r') as f:
    pom = f.read()

  with open('pom.xml', 'w') as f:
    f.write(pom.replace('0.0.0-SNAPSHOT', rev).replace('skija-native', common.skija_native_artifact_id))

  mvn = 'mvn.cmd' if common.system == 'windows' else 'mvn'
  common.check_call([
    mvn,
    'package'
  ])

  with open('pom.xml', 'w') as f:
    f.write(pom)

  return 0
示例#9
0
def main():
  common.pushd(os.path.join(os.path.dirname(__file__), os.pardir))
  shutil.rmtree("build", ignore_errors = True)
  shutil.rmtree(os.path.join(os.path.expanduser('~'), '.m2', 'repository', 'org', 'jetbrains', 'skija', 'skija-native', '0.0.0-SNAPSHOT'), ignore_errors = True)
  common.popd()
  return 0