mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-02 11:05:28 -04:00
98 lines
2.0 KiB
Groovy
98 lines
2.0 KiB
Groovy
/*
|
|
* This file was generated by the Gradle 'init' task.
|
|
*/
|
|
apply plugin: 'java'
|
|
apply plugin: 'eclipse'
|
|
// apply plugin: 'jacoco'
|
|
apply plugin: 'maven-publish'
|
|
|
|
//plugins {
|
|
// id 'java'
|
|
//id 'maven-publish'
|
|
// }
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
mavenCentral()
|
|
maven {
|
|
url = uri('https://oss.sonatype.org/content/repositories/snapshots')
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation 'junit:junit:4.13.2'
|
|
testImplementation 'com.jayway.jsonpath:json-path:2.9.0'
|
|
testImplementation 'org.mockito:mockito-core:4.2.0'
|
|
}
|
|
|
|
subprojects {
|
|
tasks.withType(Javadoc).all { enabled = false }
|
|
}
|
|
|
|
group = 'org.json'
|
|
version = 'v20250107-SNAPSHOT'
|
|
description = 'JSON in Java'
|
|
sourceCompatibility = '1.8'
|
|
|
|
configurations.all {
|
|
}
|
|
|
|
java {
|
|
withSourcesJar()
|
|
withJavadocJar()
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
from(components.java)
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
def originalFile = null;
|
|
|
|
task backupCode {
|
|
def file = file('src/main/java/org/json/JSONParserConfiguration.java')
|
|
originalFile = file.text
|
|
}
|
|
|
|
task firstTest {
|
|
|
|
}
|
|
|
|
task modifyCode {
|
|
doLast {
|
|
// Add your code modification logic here
|
|
def file = file('src/main/java/org/json/JSONParserConfiguration.java')
|
|
def text = file.text
|
|
text = text.replaceAll('oldCode', 'newCode')
|
|
file.text = text
|
|
}
|
|
}
|
|
|
|
task compileModifiedCode(type: JavaCompile) {
|
|
source = sourceSets.main.java.srcDirs
|
|
classpath = sourceSets.main.compileClasspath
|
|
destinationDirectory = sourceSets.main.java.outputDir
|
|
}
|
|
|
|
task secondTest {
|
|
|
|
}
|
|
|
|
task restoreCode {
|
|
def file = file('src/main/java/org/json/JSONParserConfiguration.java')
|
|
file.text = originalFile
|
|
}
|
|
|
|
// and then add it to the task list
|
|
backupCode.finalizedBy firstTest
|
|
firstTest.finalizedBy modifyCode
|
|
modifyCode.finalizedBy compileModifiedCode
|
|
compileModifiedCode.finalizedBy secondTest
|
|
secondTest.finalizedBy restoreCode |