Commit 796df58f authored by 王雷's avatar 王雷

Initial commit

parents
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
# Ignore Gradle project-specific cache directory
.gradle
# Ignore Gradle build output directory
build
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="GradlePlugin" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4" />
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$USER_HOME$/gradle/gradle-6.4.1" />
<option name="gradleJvm" value="#JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="date" />
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven5" />
<option name="name" value="maven5" />
<option name="url" value="http://developer.huawei.com/repo/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven7" />
<option name="name" value="maven7" />
<option name="url" value="http://maven.aliyun.com/nexus/content/repositories/releases/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven9" />
<option name="name" value="maven9" />
<option name="url" value="https://hub.zmcms.cn/repository/maven-public/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://repo1.maven.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="http://maven.aliyun.com/nexus/content/repositories/google" />
</remote-repository>
<remote-repository>
<option name="id" value="maven4" />
<option name="name" value="maven4" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven6" />
<option name="name" value="maven6" />
<option name="url" value="https://jitpack.io" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="http://maven.aliyun.com/nexus/content/repositories/jcenter" />
</remote-repository>
<remote-repository>
<option name="id" value="maven8" />
<option name="name" value="maven8" />
<option name="url" value="https://oss.sonatype.org/content/groups/public" />
</remote-repository>
<remote-repository>
<option name="id" value="maven11" />
<option name="name" value="maven11" />
<option name="url" value="https://developer.huawei.com/repo/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven10" />
<option name="name" value="maven10" />
<option name="url" value="https://dl.bintray.com/umsdk/release" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Gradle plugin project to get you started.
* For more details take a look at the Writing Custom Plugins chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.6.1/userguide/custom_plugins.html
*/
buildscript{
ext.kotlin_version = '1.4.10'
repositories {
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }//阿里云镜像服务
maven { url 'http://developer.huawei.com/repo/' }
maven { url 'https://jitpack.io' }
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
}
maven {
url "https://oss.sonatype.org/content/groups/public"
}
maven {
url 'https://hub.zmcms.cn/repository/maven-public/'
}
maven { url 'https://dl.bintray.com/umsdk/release' }
maven { url 'https://developer.huawei.com/repo/' }
}
}
plugins {
// Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins
id 'java-gradle-plugin'
// Apply the Groovy plugin to add support for Groovy
id 'groovy'
id 'maven'
id 'java'
id "org.jetbrains.kotlin.jvm" version "1.4.10"
}
repositories {
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }//阿里云镜像服务
maven { url 'http://developer.huawei.com/repo/' }
maven { url 'https://jitpack.io' }
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
}
maven {
url "https://oss.sonatype.org/content/groups/public"
}
maven {
url 'https://hub.zmcms.cn/repository/maven-public/'
}
maven { url 'https://dl.bintray.com/umsdk/release' }
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
// Use the Kotlin JDK 8 standard library.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// Use the Kotlin test library.
testImplementation("org.jetbrains.kotlin:kotlin-test")
// Use the Kotlin JUnit integration.
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
// Use the awesome Spock testing and specification framework
implementation 'com.android.tools.build:gradle:4.2.0'
testImplementation 'org.spockframework:spock-core:1.3-groovy-2.5'
implementation gradleApi()
compile 'org.json:json:20090211'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'commons-lang:commons-lang:2.6'
runtime 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'commons-lang:commons-lang:2.6'
implementation 'com.aliyun.dpa:oss-android-sdk:2.9.5'
implementation 'com.aliyun.oss:aliyun-sdk-oss:3.10.2'
implementation "com.squareup.okhttp3:okhttp:4.9.1"
implementation 'com.google.code.gson:gson:2.8.8'
}
gradlePlugin {
// Define the plugin
/* plugins {
greeting {
id = 'GradlePlugin.greeting'
implementationClass = 'GradlePlugin.GradlePluginPlugin'
}
jiagu{
id = 'GradlePlugin.jiagu'
implementationClass = 'com.qmai.android.plugin.jg.JiaGuPlugin'
}
}*/
plugins {
buildAndOss {
id = 'GradlePlugin.buildAndOss'
implementationClass = 'com.qmai.android.plugin.OssBuildAndUploadPlugin'
}
}
plugins {
buildAndPyger {
id = 'GradlePlugin.buildAndPyger'
implementationClass = 'GradlePlugin.PygerBuildAndUploadPlugin'
}
}
plugins {
OssFile {
id = 'GradlePlugin.OssFile'
implementationClass = 'com.qmai.android.plugin.OssFileUploadPlugin'
}
}
plugins {
pygerUpload {
id = 'GradlePlugin.pygerUpload'
implementationClass = 'GradlePlugin.PygerUploadPlugin'
}
}
}
uploadArchives {
repositories.mavenDeployer {
repository(url: uri('https://hub.zmcms.cn/repository/maven-releases/')){
authentication(userName: 'wanglei1', password: 'woshiwanglei123')
} // 本地仓库路径
pom.groupId = "com.qmai.android.plugin"// 唯一标识(通常为模块包名,也可以任意)
pom.artifactId = "AndroidPlugins" // 项目名称(通常为类库模块名称,也可以任意)
pom.version = "1.28" // 版本号
/* snapshotRepository(url: 'https://hub.zmcms.cn/repository/maven-snapshots/') {
authentication(userName: 'wanglei1', password: 'woshiwanglei123')
}*/
}
}
// Add a source set for the functional test suite
sourceSets {
functionalTest {
}
}
gradlePlugin.testSourceSets(sourceSets.functionalTest)
configurations.functionalTestImplementation.extendsFrom(configurations.testImplementation)
// Add a task to run the functional tests
tasks.register('functionalTest', Test) {
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
}
check {
// Run the functional tests as part of `check`
dependsOn(tasks.functionalTest)
}
task test11{
dependsOn("printVersionInfo")
doLast{
}
}
/* userName USER_NAME
userPassword USER_PASSWORD
keyStorePath file("../.keystore/release.keystore").absolutePath
keyStorePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyAliasPassword RELEASE_KEY_PASSWORD
jarToolsPath 'D:\\sign\\360jiagubao_windows_64\\jiagu\\jiagu.jar'
*/
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Tue Aug 24 09:52:39 CST 2021
sdk.dir=/Users/leiwang/Library/Android/sdk
def versionName = "1.0.0"
task printVersionInfo{
doLast{
println "versionName: $versionName"
}
}
\ No newline at end of file
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/6.6.1/userguide/multi_project_builds.html
*/
rootProject.name = 'GradlePlugin'
/*
* This Groovy source file was generated by the Gradle 'init' task.
*/
package GradlePlugin
import spock.lang.Specification
import org.gradle.testkit.runner.GradleRunner
/**
* A simple functional test for the 'GradlePlugin.greeting' plugin.
*/
public class GradlePluginPluginFunctionalTest extends Specification {
def "can run task"() {
given:
def projectDir = new File("build/functionalTest")
projectDir.mkdirs()
new File(projectDir, "settings.gradle") << ""
new File(projectDir, "build.gradle") << """
plugins {
id('GradlePlugin.greeting')
}
"""
when:
def runner = GradleRunner.create()
runner.forwardOutput()
runner.withPluginClasspath()
runner.withArguments("greeting")
runner.withProjectDir(projectDir)
def result = runner.build()
then:
result.output.contains("Hello from plugin 'GradlePlugin.greeting'")
}
}
package GradlePlugin
import org.gradle.api.Project
import org.gradle.api.Plugin
/**
* A simple 'hello world' plugin.
*/
public class CustomPlugin implements Plugin<Project> {
public void apply(Project project) {
project.extensions.add("myextenstion",MyExtenstion)
// Register a task
project.tasks.register("greeting1") {
doLast {
println("Hello from plugin 'GradlePlugin.greeting'")
def extensions = project.myextenstion
println ">>> extenstion= ${extensions.name}"
}
}
}
}
\ No newline at end of file
package GradlePlugin
class DingDingDetailInfoModel {
String content
DingDingDetailInfoModel(String content){
this.content = content
}
}
package GradlePlugin
/*
con={"msgtype":"text","text":{"content":content}}
*/
class DingDingInfoModel {
String msgtype = "text"
DingDingDetailInfoModel text
DingDingInfoModel(DingDingDetailInfoModel text){
this.text = text
}
}
/*
* This Groovy source file was generated by the Gradle 'init' task.
*/
package GradlePlugin
import com.aliyun.oss.OSS
import com.aliyun.oss.OSSClientBuilder
import com.google.protobuf.ServiceException
import com.squareup.okhttp.OkHttpClient
import org.gradle.api.Project
import org.gradle.api.Plugin
import org.gradle.internal.impldep.com.amazonaws.services.s3.model.PutObjectRequest
import org.gradle.internal.impldep.com.amazonaws.services.s3.model.PutObjectResult
/**
* A simple 'hello world' plugin.
*/
public class GradlePluginPlugin implements Plugin<Project> {
public void apply(Project project) {
// Register a task
project.tasks.register("greeting") {
doLast {
println("Hello from plugin 'GradlePlugin.greeting'")
}
}
}
}
class MyExtenstion{
String name
}
\ No newline at end of file
package GradlePlugin
class PygerBean {
String filePath
String key = "cd6545d205ac6cc379bb1d6e3ce71bed"
}
\ No newline at end of file
package GradlePlugin
class PygerBuildAndUploadBean {
String filePath
String key = "cd6545d205ac6cc379bb1d6e3ce71bed"
}
\ No newline at end of file
package GradlePlugin
import com.android.build.gradle.AppExtension
import com.android.build.gradle.api.ApplicationVariant
import com.android.build.gradle.api.BaseVariantOutput
import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project
/***
* 编译加上传到oss中
*/
class PygerBuildAndUploadPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
PygerBean PygerBean = project.getExtensions().create("BuildAndPygerInfo", PygerBean.class)
project.afterEvaluate {
// AppExtension app = project.
AppExtension app = project.getExtensions().findByType(AppExtension.class)
app.getApplicationVariants().all(new Action<ApplicationVariant>() {
@Override
void execute(ApplicationVariant applicationVariant) {
def name = applicationVariant.getName()
applicationVariant.outputs.all(new Action<BaseVariantOutput>() {
@Override
void execute(BaseVariantOutput baseVariantOutput) {
File flie = baseVariantOutput.getOutputFile()
def task = project.getTasks().create("buildAndPyger" + firstLetterUpper(name), PygerUploadTask.class, flie,PygerBean)
//先编译
task.dependsOn("assemble" + firstLetterUpper(name))
}
})
}
})
}
};
//首字符大写
String firstLetterUpper(String str) {
char[] cs = str.toCharArray()
cs[0] -= 32
return String.valueOf(cs)
}
}
package GradlePlugin
import com.android.tools.r8.graph.S
class PygerInfoBean {
PayerDetailInfo data
}
class PayerDetailInfo {
String buildQRCodeURL
String buildShortcutUrl
}
package GradlePlugin
import org.gradle.api.Plugin
import org.gradle.api.Project
/***
* 通过蒲公英上传
*/
class PygerUploadPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
PygerBean pygerBean = project.getExtensions().create("pyger", PygerBean.class)
project.afterEvaluate {
project.getTasks().create("pygerUpload", PygerUploadTask.class, new File(pygerBean.filePath), pygerBean)
}
}
}
package GradlePlugin
import com.aliyun.oss.OSS
import com.aliyun.oss.OSSClientBuilder
import com.google.gson.Gson
import okhttp3.MediaType
import okhttp3.MultipartBody
import okhttp3.OkHttp
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import org.gradle.api.Action
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
import org.gradle.internal.impldep.com.amazonaws.services.s3.model.PutObjectRequest
import org.gradle.internal.impldep.com.google.gson.JsonObject
import org.gradle.process.ExecSpec
import org.json.JSONException
import org.json.JSONObject
import javax.inject.Inject
import java.util.concurrent.TimeUnit
class PygerUploadTask extends DefaultTask {
File file;
PygerBean pygerBean
@Inject
public PygerUploadTask(File file, PygerBean pygerBean) {
this.file = file
this.pygerBean = pygerBean
setGroup("pyger")
}
@TaskAction
public void upload() {
MultipartBody.Builder bodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM)
//add part
bodyBuilder.addFormDataPart("_api_key", pygerBean.key)
//add file
bodyBuilder.addFormDataPart("file", file.getName(), RequestBody
.create(MediaType.parse("*/*"), file))
//request
Request request = new Request.Builder()
.url("https://www.pgyer.com/apiv2/app/upload")
.post(bodyBuilder.build())
.build()
OkHttpClient client = new OkHttpClient.Builder()
.callTimeout(60, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.build()
try {
println("开始上传蒲公英")
Response response = client.newCall(request).execute()
String result = response.body().string()
Gson gson = new Gson()
PygerInfoBean payInfoBean = gson.fromJson(result, PygerInfoBean.class)
println("下载地址为: downloadUrl:" + " https://www.pgyer.com/" + payInfoBean.data.buildShortcutUrl)
println("二维码地址为:" + payInfoBean.data.buildQRCodeURL)
System.out.println("upload result: " + result)
String content = "qmshopassitant: 下载地址: " + " https://www.pgyer.com/" + payInfoBean.data.buildShortcutUrl + " \n二维码地址: " + payInfoBean.data.buildQRCodeURL
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
JSONObject json = new JSONObject()
try {
json.put("msgtype", "text:{\"content\":$content}")
json.put("text", content)
def dingDingdetail = new DingDingDetailInfoModel(content)
def dingdingInfo = new DingDingInfoModel(dingDingdetail)
RequestBody requestBody = RequestBody.create(JSON, gson.toJson(dingdingInfo))
Request request2 = new Request.Builder()
.url("https://oapi.dingtalk.com/robot/send?access_token=9839926e22043a7d391747e3cb14cc4e0dab7add001ce60f0d184f82e50301bc")
.post(requestBody)
.build()
Response response2 = client.newCall(request2).execute()
String value = response2.body().string()
println("value= " + value)
} catch (JSONException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace()
println("-----------------上传失败----------------")
println("错误原因: " + e.getMessage())
} catch (Exception e) {
println("-----------------上传失败----------------")
println("错误原因: " + e.getMessage())
}
}
}
package com.qmai.android.plugin
/***
* 自动打包且上传后指定oss的路径
*/
class OssBean {
String ossPath
}
\ No newline at end of file
package com.qmai.android.plugin
import com.android.build.gradle.AppExtension
import com.android.build.gradle.api.ApplicationVariant
import com.android.build.gradle.api.BaseVariantOutput
import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project
/***
* 编译加上传到oss中
*/
class OssBuildAndUploadPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
OssBean ossBean = project.getExtensions().create("BuildAndOssInfo", OssBean.class)
project.afterEvaluate {
// AppExtension app = project.
AppExtension app = project.getExtensions().findByType(AppExtension.class)
app.getApplicationVariants().all(new Action<ApplicationVariant>() {
@Override
void execute(ApplicationVariant applicationVariant) {
def name = applicationVariant.getName()
applicationVariant.outputs.all(new Action<BaseVariantOutput>() {
@Override
void execute(BaseVariantOutput baseVariantOutput) {
File flie = baseVariantOutput.getOutputFile()
def task = project.getTasks().create("buildAndOss" + firstLetterUpper(name), OssUploadTask.class, flie,ossBean.ossPath)
//先编译
task.dependsOn("assemble" + firstLetterUpper(name))
}
})
}
})
}
};
//首字符大写
String firstLetterUpper(String str) {
char[] cs = str.toCharArray()
cs[0] -= 32
return String.valueOf(cs)
}
}
package com.qmai.android.plugin
import org.gradle.api.Plugin
import org.gradle.api.Project
class OssFileUploadPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
//单独上传任务的task
OssUploadFileBean ossUploadFileBean = project.getExtensions().create("uploadOss",OssUploadFileBean.class)
project.afterEvaluate {
def uploadFile = new File(ossUploadFileBean.localPath)
println("single upload file "+uploadFile.exists() + " "+uploadFile.absolutePath)
project.getTasks().create("uploadOssFile", OssUploadTask.class, uploadFile,ossUploadFileBean.ossPath)
}
}
}
package com.qmai.android.plugin
/***
* oss 上传需要的参数
*/
class OssUploadFileBean {
String ossPath //oss上传的路径
String localPath // 本地文件路径
}
package com.qmai.android.plugin
import GradlePlugin.DingDingDetailInfoModel
import GradlePlugin.DingDingInfoModel
import com.aliyun.oss.OSS
import com.aliyun.oss.OSSClientBuilder
import com.aliyun.oss.model.PutObjectRequest
import com.google.gson.Gson
import okhttp3.MediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import org.gradle.api.Action
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
import org.gradle.process.ExecSpec
import org.json.JSONObject
import javax.inject.Inject
import java.util.concurrent.TimeUnit
class OssUploadTask extends DefaultTask {
File file
String ossPath = "appfile/demo/"
@Inject
OssUploadTask(File file, String ossPath) {
this.file = file
this.ossPath = ossPath
setGroup("oss")
}
@TaskAction
void upload() {
def fileName = file.getName()
// yourEndpoint填写Bucket所在地域对应的Endpoint。以华东1(杭州)为例,Endpoint填写为https://oss-cn-hangzhou.aliyuncs.com。
String endpoint = "https://oss-cn-shanghai.aliyuncs.com"
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
String accessKeyId = "LTAIpd1FowghSQX0"
String accessKeySecret = "0kRH35xgAqyNuqabkH3u9WrstHfsd1"
// 创建OSSClient实例。
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret)
// 创建PutObjectRequest对象。
// 依次填写Bucket名称(例如examplebucket)、Object完整路径(例如exampledir/exampleobject.txt)和本地文件的完整路径。Object完整路径中不能包含Bucket名称。
// 如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件。
// 如果需要上传时设置存储类型和访问权限,请参考以下示例代码。
// ObjectMetadata metadata = new ObjectMetadata();
// metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS, StorageClass.Standard.toString());
// metadata.setObjectAcl(CannedAccessControlList.Private);
// putObjectRequest.setMetadata(metadata);
// 上传文件。
try {
println("file name= " + file.name)
println("file path= " + file.absolutePath + " " + file.getCanonicalPath())
println("file access= " + file.canRead())
println("begin upload " + file.exists())
PutObjectRequest putObjectRequest = new PutObjectRequest("qmaicn", ossPath + fileName, file)
ossClient.putObject(putObjectRequest)
println("--------------------------------------------------------------------------")
println("---------" + fileName + "--------上传完成")
println("下载地址为: " + "https://files.qmai.cn/" + ossPath + fileName)
println("--------------------------------------------------------------------------")
} catch (Exception e) {
println("e= " + e.getMessage() + "E" + e)
}
// 关闭OSSClient。
ossClient.shutdown()
//钉钉通知
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
JSONObject json = new JSONObject()
def gson = new Gson()
def content = "qmshopassitant: 下载地址为: " + "https://files.qmai.cn/" + ossPath + fileName
def dingDingdetail = new DingDingDetailInfoModel(content)
def dingdingInfo = new DingDingInfoModel(dingDingdetail)
RequestBody requestBody = RequestBody.create(JSON, gson.toJson(dingdingInfo))
OkHttpClient client = new OkHttpClient.Builder()
.callTimeout(60, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.connectTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.build()
Request request2 = new Request.Builder()
.url("https://oapi.dingtalk.com/robot/send?access_token=9839926e22043a7d391747e3cb14cc4e0dab7add001ce60f0d184f82e50301bc")
.post(requestBody)
.build()
try {
Response response2 = client.newCall(request2).execute()
String value = response2.body().string()
println("send dingding response = " + value)
} catch (Exception e) {
println("send dingding error = " + e.message)
}
}
}
class PygerBean {
var key:String?=null
}
\ No newline at end of file
package com.qmai.android.plugin.jg
import org.gradle.api.Plugin
import org.gradle.api.Project
import com.android.build.gradle.AppExtension
open class JiaGuPlugin : Plugin<Project> {
override fun apply(project: Project) {
//读取360加固配置
val jiaGuPluginExtension = project.extensions
.create("jiagu", JiaGuPluginExtension::class.java)
project.afterEvaluate {
val appExtension: AppExtension = project.extensions.getByType(AppExtension::class.java) as AppExtension
appExtension.applicationVariants.all {
val name = it.name
it.outputs.all {
val outputFile = it.outputFile
val jiaGuName = "jiagu-${firstLetterUpper(it.name)}"
val jiaGuTask = project.tasks.create(
jiaGuName,
JiaGuTask::class.java,
outputFile,
jiaGuPluginExtension
)
val buildAndJiaGuName = "build-and-$jiaGuName"
println("create task:$buildAndJiaGuName")
val buildAndJiaGuTask = project.tasks.create(
buildAndJiaGuName,
JiaGuTask::class.java,
outputFile,
jiaGuPluginExtension
)
buildAndJiaGuTask.doFirst {
println("${it.name} doFirst")
}
buildAndJiaGuTask.doLast {
println("${it.name} doLast")
}
buildAndJiaGuTask.dependsOn("assemble${firstLetterUpper(name)}")
}
}
}
}
//首字符大写
fun firstLetterUpper(str: String): String {
val cs: CharArray = str.toCharArray()
var first = cs[0]
//first = (-32).toChar()
cs[0] = first.toUpperCase()
return String(cs)
}
}
\ No newline at end of file
package com.qmai.android.plugin.jg
open class JiaGuPluginExtension {
//加固jar文件存在路径
var jiaGuToolsPath: String? = "../jiagu/jiagu.jar"
var username: String? = null
var password: String? = null
var keyStoreFile: String? = null
var keyStorePassword: String? = null
var keyAlias: String? = null
var keyAliasPassword: String? = null
var channelFile: String? = null
var inputFile: String? = null
var outputFile: String? = null
var jarDownloadUrl = "http://qmaicn.oss-cn-shanghai.aliyuncs.com/appfile/360jiagu/jiagu.jar"
}
\ No newline at end of file
package com.qmai.android.plugin.jg
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
import java.io.File
import javax.inject.Inject
open class JiaGuTask(): DefaultTask() {
lateinit var apk: File
lateinit var jiaGuPluginExtension: JiaGuPluginExtension
//@Inject task的入口
@Inject
constructor(apk: File, jiaGuPluginExtension: JiaGuPluginExtension) : this() {
group = "JiaGu"
description = " 360 jiagu"
this.apk = apk
this.jiaGuPluginExtension = jiaGuPluginExtension
}
@TaskAction
fun begin() {
//判断jar文件是否存在
val file = File(jiaGuPluginExtension.jiaGuToolsPath)
if (!file.exists()){
//创建父文件
if (!file.parentFile.exists()) {
file.parentFile.mkdirs()
}
println("path= ${jiaGuPluginExtension.jiaGuToolsPath}")
//执行下载任务
project.exec {
it.commandLine("curl", "-o"
,"${jiaGuPluginExtension.jiaGuToolsPath}",
"${jiaGuPluginExtension.jarDownloadUrl}")
}
}
//判断apk是否存在
val isExsit = apk.exists()
print("apk isExsit = ${isExsit} ${if (isExsit) "apk path = ${apk.absolutePath} ${apk.name}" else ""}")
//参照360加固文档编写相应的命令
println("login 360 account")
project.exec { execSpec ->
execSpec.commandLine(
"java", "-jar", jiaGuPluginExtension.jiaGuToolsPath,
"-login", jiaGuPluginExtension.username, jiaGuPluginExtension.password
)
}
println("import sign")
project.exec { execSpec ->
execSpec.commandLine(
"java",
"-jar",
jiaGuPluginExtension.jiaGuToolsPath,
"-importsign",
jiaGuPluginExtension.keyStoreFile,
jiaGuPluginExtension.keyStorePassword
,
jiaGuPluginExtension.keyAlias,
jiaGuPluginExtension.keyAliasPassword
)
}
jiaGuPluginExtension?.let {
val filePath = apk.getParent()
println("config ")
project.exec { execSpec ->
execSpec.commandLine("java", "-jar", jiaGuPluginExtension.jiaGuToolsPath,
"-jiagu", apk.getAbsolutePath(), filePath, "-autosign")
}
}
println("origin apk.absolutePath:${apk.absolutePath}")
println("source apk.absolutePath:${apk.parent}")
}
}
\ No newline at end of file
/*
* This Groovy source file was generated by the Gradle 'init' task.
*/
package GradlePlugin
import org.gradle.testfixtures.ProjectBuilder
import org.gradle.api.Project
import spock.lang.Specification
/**
* A simple unit test for the 'GradlePlugin.greeting' plugin.
*/
public class GradlePluginPluginTest extends Specification {
def "plugin registers task"() {
given:
def project = ProjectBuilder.builder().build()
when:
project.plugins.apply("GradlePlugin.greeting")
then:
project.tasks.findByName("greeting") != null
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment