在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):j2objc-contrib/j2objc-gradle开源软件地址(OpenSource Url):https://github.com/j2objc-contrib/j2objc-gradle开源编程语言(OpenSource Language):Groovy 87.7%开源软件介绍(OpenSource Introduction):j2objc-discuss if you are interested. Active development on this plugin is otherwise currently suspended.Hey! We are looking for new developers to maintain the plugin. Let us know onJ2ObjC Gradle PluginThe J2ObjC Gradle plugin enables Java source to be part of an iOS application's build so you can write an app's non-UI code (such as application logic and data models) in Java, which is then shared by Android apps (natively Java) and iOS apps (using J2ObjC). The plugin:
The plugin is not affiliated with Google but was developed by former Google Engineers and others. Note that the plugin is currently in alpha; we may need to make breaking API changes before the 1.0 release. Home Page: https://github.com/j2objc-contrib/j2objc-gradle Quick Start GuideYou should start with a clean Java only project without any Android dependencies.
It is suggested that the project is named The Android app, shared Java project and Xcode project should be sibling directories, i.e children
of the same root level folder. Suggested folder names are Configure // File: shared/build.gradle
plugins {
id 'java'
id 'com.github.j2objccontrib.j2objcgradle' version '0.5.0-alpha'
}
dependencies {
// Any libraries you depend on, like Guava or JUnit
compile 'com.google.guava:guava:18.0'
testCompile 'junit:junit:4.11'
}
// Plugin settings; put these at the bottom of the file.
j2objcConfig {
// Sets up libraries you depend on
autoConfigureDeps true
// Omit these two lines if you don't configure your Xcode project with CocoaPods
xcodeProjectDir '../ios' // suggested directory name
xcodeTargetsIos 'IOS-APP', 'IOS-APPTests' // replace with your iOS targets
finalConfigure() // Must be last call to configuration
} Finally, make the Android application's // File: android/build.gradle
dependencies {
compile project(':shared')
} For more complex situations like:
, check the FAQ table of contents or see all of the Minimum RequirementsThe plugin requries modern versions of Gradle and J2ObjC, and assumes the J2ObjC Requirements:
Applications built with the plugin may target
J2ObjC InstallationIf J2ObjC is not detected when the plugin is first run, on-screen instructons will guide you through installation from your Terminal. Alternatively: Download the latest version from the J2ObjC Releases. Find (or add) the local.properties in your root folder and add the path to the unzipped folder: # File: local.properties
j2objc.home=/J2OBJC_HOME Build CommandsThe plugin will output the generated source and libaries to the It is integrated with Gradle's Java build plugin and may be run as follows:
ProblemsHaving issues with the plugin? Please first check the Frequently Asked Questions. Next, search the Issues for a similar problem. If your issue is not addressed, please file a new Issue, including the following details:
If you are not comfortable sharing these, the community may not be able to help as much. Please note your bug reports will be treated as "Contribution(s)" per the LICENSE. Mozilla's Bug writing guidelines may be helpful. Having public, focused, and actionable Issues helps the maximum number of users and also lets the maximum number of people help you. Please do not email the authors directly. FAQPlease see FAQ.md. ContributingSee CONTRIBUTING.md. LicenseThis library is distributed under the Apache 2.0 license found in the LICENSE file. J2ObjC and libraries distributed with J2ObjC are under their own licenses. Footnotes[1] where source is appropriately licensed and available |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论