Skip to content

Commit

Permalink
update gradle version
Browse files Browse the repository at this point in the history
  • Loading branch information
WindySha committed Aug 31, 2021
1 parent 6b9a9ce commit 382a3be
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 42 deletions.
53 changes: 19 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,53 +1,38 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'eclipse'
version = '4.1'

buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.1'
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

defaultTasks('clean','distZip')

subprojects {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = 1.8
targetCompatibility = 1.8



// task packageSources(type: Jar) {
// classifier = 'sources'
// from sourceSets.main.allSource
// }
// artifacts.archives packageSources

repositories {
google()
mavenCentral()
jcenter()

maven { url "https://jitpack.io" }
}

[compileJava, compileTestJava]*.options.collect {options ->options.encoding = 'UTF-8'}
}

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}

jar {
manifest {
attributes("Implementation-Title": project.name,
"Implementation-Version": project.version,
"Build-Time": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Build-Number": System.env.BUILD_NUMBER?System.env.BUILD_NUMBER:"-1",
)
}
from (project.parent.projectDir) {
include 'NOTICE.txt'
include 'LICENSE.txt'
into('META-INF')
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Mar 06 01:11:44 CST 2019
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
zipStoreBase=GRADLE_USER_HOME
32 changes: 26 additions & 6 deletions xpatch/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,45 @@
apply plugin: 'java-library'
plugins {
id 'java-library'
}

compileJava.options.encoding = "UTF-8"

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

jar{
baseName = "xpatch"
jar {
baseName = 'xpatch'
version = '4.1'
manifest {
attributes 'Main-Class': 'com.storm.wind.xpatch.MainCommand'
}
destinationDirectory = new File("$rootProject.projectDir/out")
//添加将引用的jar的源码打入最终的jar
dependsOn configurations.runtimeClasspath
from {
(configurations.runtime).collect {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}

from fileTree(dir:'src/main', includes: ['assets/**'])
from fileTree(dir: 'src/main', includes: ['assets/**'])

//排除引用的jar中的签名信息
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF'
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF', 'META-INF/*.txt', "META-INF/versions/**"

manifest {
attributes("Implementation-Title": baseName,
"Implementation-Version": version,
"Build-Time": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Build-Number": System.env.BUILD_NUMBER ? System.env.BUILD_NUMBER : "-1",
)
}
from(project.parent.projectDir) {
include 'NOTICE.txt'
include 'LICENSE.txt'
into('META-INF')
}
}

//添加源码中引入的非代码文件,例如资源等
Expand Down

0 comments on commit 382a3be

Please sign in to comment.