在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):multi-os-engine/moe-plugin-gradle开源软件地址(OpenSource Url):https://github.com/multi-os-engine/moe-plugin-gradle开源编程语言(OpenSource Language):Java 98.6%开源软件介绍(OpenSource Introduction):MOE Gradle PluginThe MOE Gradle plugin adds support to building MOE based applications via Gradle. Table of Contents
Other DocumentsBasicsPluginsThere are two Gradle plugins:
BuildingBuild and publish release version to Maven local repository: cd <repo>/moe/tools/master
./gradlew :moe-gradle:publishMavenJavaPublicationToMavenLocal Build and publish snapshot version to Maven local repository: cd <repo>/moe/tools/master
./gradlew :moe-gradle:publishMavenJavaSnapshotPublicationToMavenLocal Build and publish release version to Bintray: cd <repo>/moe/tools/master
./gradlew :moe-gradle:bintrayUpload \
-Pbintray.user=user \
-Pbintray.key=key Build and publish snapshot version to Artifactory: cd <repo>/moe/tools/master
./gradlew :moe-gradle:artifactoryPublish \
-Partifactory.url=url \
-Partifactory.key=key \
-Partifactory.user=user \
-Partifactory.pass=pass Debugging the PluginBefore running Gradle, export the following: export GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" This way you can remote connect to debug the plugin. SDKThe plugin knows which SDK to download, and automatically installs it into the The default installation directory can be overridden via the The plugin's associated SDK is also customizable and is evaluated as follows:
The SDK's structure must be as follows, otherwise the validation will fail:
ConfigurationSDKYou may configure a custom SDK version as follows in the build.gradle file: buildscript {
project.getExtensions().getExtraProperties().set("moeSDKVersion", 1.3.+)
...
} ProGuardProGuard can be configured globally here, or per-config in ProGuard Task. moe {
proguard {
// apply level
level = 'platform'
// path to the base configuration file, or `null` to use SDK default config
baseCfgFile = null
// null or path to to appended configuration file
appendCfgFile = null
// whether code minification is enabled. Ignored when `baseCfgFile` is specified. Default to `true`
minifyEnabled = true
// whether code obfuscation is enabled. Ignored when `baseCfgFile` is specified. Default to `false`
obfuscationEnabled = false
// exclude files from `-injars` config that will be processed by proguard
excludeFiles = [
'META-INF/*.SF',
'META-INF/*.DSA',
'META-INF/*.RSA'
]
excludeFile 'org/bouncycastle/jce/provider/*Spi_8.class'
}
} ProGuard has three supported levels of trimming:
At any of these levels ProGuard may trim out classes which are needed at compile/runtime. For further configuration see ProGuard Task. Xcode ProjectGenerated Xcode project settings can be configured as follows: moe {
xcode {
// Object, path to the Xcode project.
project
// Object, path to the Xcode workspace.
workspace
// String, name of the main target.
mainTarget
// String, name of the test target.
testTarget
// String, name of the main scheme.
mainScheme
// String, name of the test scheme.
testScheme
}
} Note: when working with Xcode workspaces, scheme settings are required! Code SigningCode signing can be configured by the following options: moe {
signing {
// String, ID of the development team.
developmentTeam
// String, path to the provisioning profile or UUID.
provisioningProfile
// String, name of the provisioning profile (new in Xcode 8).
provisioningProfileSpecifier
// String, name of the signing identity
signingIdentity
}
} Code Signing DefaultsThe development team setting can have a default value which can be set in this file:
Resource PackagingResource packaging into the application.jar can be configured in the build script with the following options: moe {
packaging {
excludes = ['LICENSE', 'LICENSE.*']
exclude 'README.md' // Excludes the README.md file from the application.jar
}
resources {
// Enables resources from the source directory
enableResourcesFromSourceDirs = true
// Excludes all Java source files when copying from the source directory
resourcesFromSourceDirExcludes = ['**/*.java']
}
} Java ProcessesVM arguments for launched Java processes can be customized, for example custom moe {
javaProcess {
jvmArgs '-Xmx4096m'
}
} UI Actions and OutletsGenerating Objective-C interfaces can be configured to limit what should be generated. By default all classes marked
with moe {
actionsAndOutlets {
// Only include classes matching any regex in this array, setting to empty list resets to default behavior
includes = ['org\\.moe\\.\\w*Controller']
// Add include criteria regex to the includes array
include 'org\\.moe\\.\\w*Controller'
// Additional code to be generated into the Objective-C source
additionalCodes = ['@class MyObjCOnlyClass;']
additionalCode '#import "MyClass.h"'
// Disable the generation of specified `@import`'s
excludeLibraries = ['NotValidImport']
excludeLibrary 'UIKit'
}
} TasksProGuard TaskTask name: This task collects the dependent jar files and invokes ProGuard with a set of predefined and (optional) custom rules.
The rules are composed of two parts. The first part comes from the MOE SDK ( Task Properties
Setting any of these properties to null will reset them to their default values. Retrolambda TaskTask name: This task collects the class files and invokes Retrolambda on them. This will create Java 7 compatible class files from Java 8 class files. Task Properties
Setting any of these properties to null will reset them to their default values. Dex TaskTask name: We need to create a dex file from the proguarded jar which we can later on convert to art and oat files. This task is
responsible for that. The result of this task is a Task Properties
Setting any of these properties to null will reset them to their default values. Dex2Oat TaskTask name:
For Android's ART runtime to function we need to provide an art and an oat file which contains application code
information and everything required by the application to be able to run. This task creates those files from the
specified dex file created by the Dex task. The results of this task is an Task Properties
Setting any of these properties to null will reset them to their default values. StartupProvider TaskTask name: MOE supports extending Objective-C classes from Java, but there are some special cases where we need to register some
classes even before the Objective-C runtime initializes. These classes must be collected at build time and this task is
responsible for that. The classes it needs to collect are marked with a Task Properties
Setting any of these properties to null will reset them to their default values. ResourcePackager TaskTask name: This task collects the resource files used by the application. These files can originate from the application's resource
folder, dependent jars and additional external sources specified in the build script.
The result of this task is an TestClassesProvider TaskTask name: MOE supports running JUnit tests on iOS devices. This requires a list of classes which contain the JUnit tests. This task collects these classes and writes them out in a text file. Task Properties
Setting any of these properties to null will reset them to their default values. GenerateUIObjCInterfaces TaskTask name: Generates Objective-C class interfaces for working with Xcode's Interface Builder. Task Properties
Setting any of these properties to null will reset them to their default values. XcodeProvider TaskTask name:
This task is responsible for collecting all of the files which are needed by Xcode so it can compile the application package. This task depends on most of the tasks described above. Also, this task will throw an error if the Xcode project is not yet updated. XcodeInternal TaskTask name: This task is only called when the build is initiated from Xcode. If this is the case, Xcode will set a few environmental variables which this task will try to read and configure the other dependent tasks according to them. This task will look for the following environmental variables:
All of these variables are required, otherwise the task will fail. XcodeBuild TaskTask name:
This task invokes Task Properties
Remote Build Properties
moe {
remoteBuild {
resources = [ file("../android/assets") ]
}
} IpaBuild TaskTask name: This task creates an ipa from the app. Note: Settings the Ipa export Scheme, Developer Team in the code signing options is required! Ipa export can be configured by the following options: moe {
ipaExport {
// (String) Path to the export options plist. If this defined, all other settings ignored
plistFile
// (Boolean) For non-App Store exports, should Xcode re-compile the app from bitcode? Defaults to false.
compileBitcode
// (Boolean) For non-App Store exports, if the app uses On Demand Resources and this is true,
// asset packs are embedded in the app bundle so that the app can be tested without a server to host asset
// packs. Defaults to true unless onDemandResourcesAssetPacksBaseURL is specified.
embedOnDemandResourcesAssetPacksInBundle
// (String) For non-App Store exports, if the app is using CloudKit, this configures the
// "com.apple.developer.icloud-container-environment" entitlement. Available options: Development and Production.
// Defaults to Development.
iCloudContainerEnvironment
// For non-App Store exports, users can download your app over the web by opening your distribution manifest
// file in a web browser. To generate a distribution manifest, the value of this key should be a dictionary with
// three sub-keys:
appURL
displayImageURL
fullSizeImageURL
// (String) Describes how Xcode should export the archive. Available options: app-store, ad-hoc, package,
// enterprise, development, and developer-id. The list of options varies based on the type of archive. Defaults
// to development.
method
// (String) For non-App Store exports, if the app uses On Demand Resources and
// embedOnDemandResourcesAssetPacksInBundle isn't YES, this should be a base URL specifying where asset packs
// are going to be hosted. This configures the app to download asset packs from the specified URL.
onDemandResourcesAssetPacksBaseURL
// (String) For non-App Store exports, should Xcode thin the package for one or more device variants? Available
// options: <none> (Xcode produces a non-thinned universal app), <thin-for-all-variants> (Xcode produces a
// universal app and all available thinned variants), or a model identifier for a specific device
// (e.g. "iPhone7,1"). Defaults to <none>.
thinning
// (Boolean) For App Store exports, should the package include bitcode? Defaults to false.
uploadBitcode
// (Boolean) For App Store exports, should the package include sy |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论