예제 #1
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--skija-version')
    parser.add_argument('--verbose', action='store_true')
    (args, _) = parser.parse_known_args()

    # Javac
    classpath = [
        common.fetch_maven('org.projectlombok', 'lombok', '1.18.16'),
        common.fetch_maven('com.google.code.gson', 'gson', '2.8.6')
    ]

    if args.skija_version:
        classpath += [
            common.fetch_maven(
                'org.jetbrains.skija',
                'skija-shared',
                args.skija_version,
                repo='https://packages.jetbrains.team/maven/p/skija/maven'),
            common.fetch_maven(
                'org.jetbrains.skija',
                common.skija_native_artifact_id,
                args.skija_version,
                repo='https://packages.jetbrains.team/maven/p/skija/maven'),
        ]
    else:
        # native_build.main()
        classpath += [
            os.path.join('..', '..', 'native', 'build'),
            os.path.join('..', '..', 'shared', 'target', 'classes')
        ]

    os.chdir(os.path.join(os.path.dirname(__file__), os.pardir))

    sources = common.glob('src_java', '*.java') + common.glob(
        '../scenes/src', '*.java')
    common.javac(classpath, sources, 'target/classes')

    # Rust
    common.check_call(['cargo', 'build', '--release', '--lib'])

    # Java
    env = os.environ.copy()
    env['RUST_BACKTRACE'] = '1'
    # if 'windows' == common.system:
    #   env['KWINIT_ANGLE'] = '1'

    common.check_call([
        'java', '--class-path',
        common.classpath_separator.join(['target/classes'] + classpath)
    ] + (['-XstartOnFirstThread'] if 'macos' == common.system else []) + [
        '-Djava.awt.headless=true', '-enableassertions',
        '-enablesystemassertions', '-Dskija.logLevel=DEBUG',
        'noria.kwinit.impl.Main'
    ] + (["--verbose"] if args.verbose else []),
                      env=env)

    return 0
예제 #2
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
예제 #3
0
def main():
  parser = argparse.ArgumentParser()
  parser.add_argument('--skija-version')
  (args, _) = parser.parse_known_args()

  # Javac
  lwjgl_classifier = "natives-" + common.system
  classpath = [
    common.fetch_maven('org.projectlombok', 'lombok', '1.18.20'),
    common.fetch_maven('org.lwjgl', 'lwjgl', '3.2.3'),
    common.fetch_maven('org.lwjgl', 'lwjgl-glfw', '3.2.3'),
    common.fetch_maven('org.lwjgl', 'lwjgl-opengl', '3.2.3'),
    common.fetch_maven('org.lwjgl', 'lwjgl', '3.2.3', classifier=lwjgl_classifier),
    common.fetch_maven('org.lwjgl', 'lwjgl-glfw', '3.2.3', classifier=lwjgl_classifier),
    common.fetch_maven('org.lwjgl', 'lwjgl-opengl', '3.2.3', classifier=lwjgl_classifier)
  ]

  if args.skija_version:
    classpath += [
      common.fetch_maven('org.jetbrains.skija', 'skija-shared', args.skija_version, repo='https://packages.jetbrains.team/maven/p/skija/maven'),
      common.fetch_maven('org.jetbrains.skija', common.skija_native_artifact_id, args.skija_version, repo='https://packages.jetbrains.team/maven/p/skija/maven'),
    ]
  else:
    classpath += [
      os.path.join('..', '..', 'native', 'build'),
      os.path.join('..', '..', 'shared', 'target', 'classes')
    ]

  os.chdir(os.path.join(os.path.dirname(__file__), os.pardir))

  sources = common.glob('src', '*.java') + common.glob('../scenes/src', '*.java')
  common.javac(classpath, sources, 'target/classes')

  # Java
  common.check_call([
    'java',
    '--class-path', common.classpath_separator.join(['target/classes'] + classpath)]
    + (['-XstartOnFirstThread'] if 'macos' == common.system else [])
    + ['-Djava.awt.headless=true',
    '-enableassertions',
    '-enablesystemassertions',
    '-Xcheck:jni',
    '-Dskija.logLevel=DEBUG',
    'org.jetbrains.skija.examples.lwjgl.Main'])

  return 0
예제 #4
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
예제 #5
0
파일: run.py 프로젝트: JetBrains/skija
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--skija-version')
    (args, _) = parser.parse_known_args()

    # Javac
    swt_artifact = {
        'macos': 'org.eclipse.swt.cocoa.macosx.x86_64',
        'windows': 'org.eclipse.swt.win32.win32.x86_64',
        'linux': 'org.eclipse.swt.gtk.linux.x86_64'
    }[common.system]
    classpath = [
        # common.fetch_maven('org.projectlombok', 'lombok', '1.18.20'),
        common.fetch_maven('org.eclipse.platform', swt_artifact, '3.115.100')
    ]

    if args.skija_version:
        classpath += [
            common.fetch_maven(
                'org.jetbrains.skija',
                'skija-shared',
                args.skija_version,
                repo='https://packages.jetbrains.team/maven/p/skija/maven'),
            common.fetch_maven(
                'org.jetbrains.skija',
                'skija-' + common.classifier,
                args.skija_version,
                repo='https://packages.jetbrains.team/maven/p/skija/maven'),
        ]
    else:
        build.main()
        classpath += [
            os.path.join('..', '..', 'platform', 'target', 'classes'),
            os.path.join('..', '..', 'shared', 'target', 'classes')
        ]

    os.chdir(os.path.join(os.path.dirname(__file__), os.pardir))

    sources = common.glob('src', '*.java')
    common.javac(sources, 'target/classes', classpath=classpath, release='16')

    # Java
    common.check_call([
        'java', '--class-path',
        common.classpath_separator.join(['target/classes'] + classpath)
    ] + (['-XstartOnFirstThread'] if 'macos' == common.system else []) + [
        '-Djava.awt.headless=true', '-enableassertions',
        '-enablesystemassertions', '-Dskija.logLevel=DEBUG',
        'org.jetbrains.skija.examples.swt.Main'
    ])

    return 0
예제 #6
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
예제 #7
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--skija-version')
    parser.add_argument('--jwm-version', default='0.1.170')
    parser.add_argument('--jwm-dir', default=None)
    (args, _) = parser.parse_known_args()

    # Javac
    classpath = [
        common.fetch_maven('org.projectlombok', 'lombok', '1.18.20'),
        common.fetch_maven('org.jetbrains', 'annotations', '20.1.0')
    ]

    if args.jwm_dir:
        jwm_dir = os.path.abspath(args.jwm_dir)
        classpath += [
            os.path.join(jwm_dir, 'shared', 'target', 'classes'),
            os.path.join(jwm_dir, common.system, 'build'),
            os.path.join(jwm_dir, common.system, 'target', 'classes')
        ]
    else:
        classpath += [
            common.fetch_maven(
                'org.jetbrains.jwm',
                'jwm-shared',
                args.jwm_version,
                repo='https://packages.jetbrains.team/maven/p/jwm/maven'),
            common.fetch_maven(
                'org.jetbrains.jwm',
                'jwm-' + common.system + '-' + common.arch,
                args.jwm_version,
                repo='https://packages.jetbrains.team/maven/p/jwm/maven'),
        ]

    if args.skija_version:
        classpath += [
            common.fetch_maven(
                'org.jetbrains.skija',
                'skija-shared',
                args.skija_version,
                repo='https://packages.jetbrains.team/maven/p/skija/maven'),
            common.fetch_maven(
                'org.jetbrains.skija',
                'skija-' + common.classifier,
                args.skija_version,
                repo='https://packages.jetbrains.team/maven/p/skija/maven'),
        ]
    else:
        build.main()
        classpath += [
            os.path.join('..', '..', 'platform', 'target', 'classes'),
            os.path.join('..', '..', 'shared', 'target', 'classes')
        ]

    os.chdir(common.root + '/examples/jwm')

    sources = common.glob('src', '*.java') + common.glob(
        '../scenes/src', '*.java')
    common.javac(sources, 'target/classes', classpath=classpath, release='16')

    # Java
    common.check_call([
        'java', '--class-path',
        common.classpath_separator.join(['target/classes'] + classpath)
    ] + (['-XstartOnFirstThread'] if 'macos' == common.system else []) + [
        '-Djava.awt.headless=true', '-enableassertions',
        '-enablesystemassertions', '-Xcheck:jni', '-Dskija.logLevel=DEBUG',
        'org.jetbrains.skija.examples.jwm.Main'
    ])

    return 0