forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
2,327 additions
and
2,209 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,78 @@ | ||
evaluationDependsOn(':checker-qual') | ||
|
||
task copySources(type: Copy) { | ||
description 'Copy checker-qual source to checker-qual-android' | ||
description 'Copy checker-qual source to checker-qual-android' | ||
|
||
includeEmptyDirs = false | ||
doFirst { | ||
// Delete the directory in case a previously copied file should no longer be in checker-qual | ||
delete file('src') | ||
} | ||
from files('../checker-qual/src/main') | ||
include '**/*.java' | ||
exclude '**/SignednessUtilExtra.java' | ||
into file('src/main') | ||
includeEmptyDirs = false | ||
doFirst { | ||
// Delete the directory in case a previously copied file should no longer be in checker-qual | ||
delete file('src') | ||
} | ||
from files('../checker-qual/src/main') | ||
include '**/*.java' | ||
exclude '**/SignednessUtilExtra.java' | ||
into file('src/main') | ||
|
||
// Not read only because "replaceAnnotations" tasks writes to the files. | ||
fileMode(0666) | ||
dirMode(0777) | ||
// Not read only because "replaceAnnotations" tasks writes to the files. | ||
fileMode(0666) | ||
dirMode(0777) | ||
} | ||
|
||
sourcesJar.dependsOn(copySources) | ||
|
||
/** | ||
* Types annotated with runtime annotations are always kept in the main dex by the default Android Gradle plugin. | ||
* Using the standard Checker Framework annotations can lead to main dex overflows; | ||
* users of the Checker Framework may find themselves unable to build their Android apps. | ||
* By contrast, class-retention annotations are stripped out before packaging by all build systems as a convention. | ||
*/ | ||
* Types annotated with runtime annotations are always kept in the main dex by the default Android Gradle plugin. | ||
* Using the standard Checker Framework annotations can lead to main dex overflows; | ||
* users of the Checker Framework may find themselves unable to build their Android apps. | ||
* By contrast, class-retention annotations are stripped out before packaging by all build systems as a convention. | ||
*/ | ||
task replaceAnnotations { | ||
doLast { | ||
fileTree(dir: 'src', include: '**/*.java').each { | ||
it.text = it.text.replaceAll('RetentionPolicy.RUNTIME', 'RetentionPolicy.CLASS') | ||
} | ||
doLast { | ||
fileTree(dir: 'src', include: '**/*.java').each { | ||
it.text = it.text.replaceAll('RetentionPolicy.RUNTIME', 'RetentionPolicy.CLASS') | ||
} | ||
} | ||
} | ||
replaceAnnotations.dependsOn copySources | ||
|
||
compileJava.dependsOn replaceAnnotations | ||
|
||
clean { | ||
delete file('src') | ||
delete file('src') | ||
} | ||
|
||
apply from: rootProject.file('gradle-mvn-push.gradle') | ||
|
||
/** Adds information to the publication for uploading to Maven repositories. */ | ||
final checkerQualAndroidPom(publication) { | ||
sharedPublicationConfiguration(publication) | ||
publication.from components.java | ||
publication.pom { | ||
name = 'Checker Qual Android' | ||
description = 'checker-qual-android contains annotations (type qualifiers) that a programmer\n' + | ||
'writes to specify Java code for type-checking by the Checker Framework.\n' + | ||
'\n' + | ||
'The checker-qual-android artifact is identical to the checker-qual\n' + | ||
'artifact, except that in checker-qual-android annotations have classfile\n' + | ||
'retention. The default Android Gradle plugin retains types annotated with\n' + | ||
'runtime annotations in the main dex, but strips out class-retention\n' + | ||
'annotations.\n' | ||
licenses { | ||
license { | ||
name = 'The MIT License' | ||
url = 'http://opensource.org/licenses/MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
sharedPublicationConfiguration(publication) | ||
publication.from components.java | ||
publication.pom { | ||
name = 'Checker Qual Android' | ||
description = 'checker-qual-android contains annotations (type qualifiers) that a programmer\n' + | ||
'writes to specify Java code for type-checking by the Checker Framework.\n' + | ||
'\n' + | ||
'The checker-qual-android artifact is identical to the checker-qual\n' + | ||
'artifact, except that in checker-qual-android annotations have classfile\n' + | ||
'retention. The default Android Gradle plugin retains types annotated with\n' + | ||
'runtime annotations in the main dex, but strips out class-retention\n' + | ||
'annotations.\n' | ||
licenses { | ||
license { | ||
name = 'The MIT License' | ||
url = 'http://opensource.org/licenses/MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
} | ||
} | ||
publishing { | ||
publications { | ||
checkerQualAndroid(MavenPublication) { | ||
checkerQualAndroidPom it | ||
} | ||
publications { | ||
checkerQualAndroid(MavenPublication) { | ||
checkerQualAndroidPom it | ||
} | ||
} | ||
} | ||
signing { | ||
sign publishing.publications.checkerQualAndroid | ||
sign publishing.publications.checkerQualAndroid | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
// Create OSGI bundles | ||
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:6.3.1' | ||
// Don't add implementation dependencies; checker-qual.jar should have no dependencies. | ||
} | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
// Create OSGI bundles | ||
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:6.3.1' | ||
// Don't add implementation dependencies; checker-qual.jar should have no dependencies. | ||
} | ||
} | ||
|
||
plugins { | ||
id 'java-library' | ||
id 'java-library' | ||
} | ||
|
||
apply plugin: 'biz.aQute.bnd.builder' | ||
|
||
jar { | ||
manifest { | ||
attributes('Export-Package': '*') | ||
} | ||
manifest { | ||
attributes('Export-Package': '*') | ||
} | ||
} | ||
|
||
apply from: rootProject.file('gradle-mvn-push.gradle') | ||
|
||
/** Adds information to the publication for uploading to Maven repositories. */ | ||
final checkerQualPom(publication) { | ||
sharedPublicationConfiguration(publication) | ||
publication.from components.java | ||
publication.pom { | ||
name = 'Checker Qual' | ||
description = 'checker-qual contains annotations (type qualifiers) that a programmer\n' + | ||
'writes to specify Java code for type-checking by the Checker Framework.\n' | ||
licenses { | ||
license { | ||
name = 'The MIT License' | ||
url = 'http://opensource.org/licenses/MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
sharedPublicationConfiguration(publication) | ||
publication.from components.java | ||
publication.pom { | ||
name = 'Checker Qual' | ||
description = 'checker-qual contains annotations (type qualifiers) that a programmer\n' + | ||
'writes to specify Java code for type-checking by the Checker Framework.\n' | ||
licenses { | ||
license { | ||
name = 'The MIT License' | ||
url = 'http://opensource.org/licenses/MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
checkerQual(MavenPublication) { | ||
checkerQualPom it | ||
} | ||
publications { | ||
checkerQual(MavenPublication) { | ||
checkerQualPom it | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications.checkerQual | ||
sign publishing.publications.checkerQual | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
plugins { | ||
id 'java-library' | ||
id 'java-library' | ||
} | ||
|
||
dependencies { | ||
api project(':checker-qual') | ||
// Don't add implementation dependencies; checker-util.jar should have no dependencies. | ||
api project(':checker-qual') | ||
// Don't add implementation dependencies; checker-util.jar should have no dependencies. | ||
|
||
testImplementation group: 'junit', name: 'junit', version: '4.13.2' | ||
testImplementation group: 'junit', name: 'junit', version: '4.13.2' | ||
} | ||
|
||
apply from: rootProject.file('gradle-mvn-push.gradle') | ||
|
||
/** Adds information to the publication for uploading to Maven repositories. */ | ||
final checkerUtilPom(publication) { | ||
sharedPublicationConfiguration(publication) | ||
publication.from components.java | ||
publication.pom { | ||
name = 'Checker Util' | ||
description = 'checker-util contains utility classes for programmers to use at run time.' | ||
licenses { | ||
license { | ||
name = 'The MIT License' | ||
url = 'http://opensource.org/licenses/MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
sharedPublicationConfiguration(publication) | ||
publication.from components.java | ||
publication.pom { | ||
name = 'Checker Util' | ||
description = 'checker-util contains utility classes for programmers to use at run time.' | ||
licenses { | ||
license { | ||
name = 'The MIT License' | ||
url = 'http://opensource.org/licenses/MIT' | ||
distribution = 'repo' | ||
} | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
checkerUtil(MavenPublication) { | ||
checkerUtilPom it | ||
} | ||
publications { | ||
checkerUtil(MavenPublication) { | ||
checkerUtilPom it | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications.checkerUtil | ||
sign publishing.publications.checkerUtil | ||
} |
Oops, something went wrong.