File tree 2 files changed +44
-1
lines changed
2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -53,3 +53,46 @@ publishing {
53
53
tasks. withType(JavaCompile ) {
54
54
options. encoding = ' UTF-8'
55
55
}
56
+
57
+ def originalFile = null ;
58
+
59
+ task backupCode {
60
+ def file = file(' src/main/java/org/json/JSONParserConfiguration.java' )
61
+ originalFile = file. text
62
+ }
63
+
64
+ task firstTest {
65
+
66
+ }
67
+
68
+ task modifyCode {
69
+ doLast {
70
+ // Add your code modification logic here
71
+ def file = file(' src/main/java/org/json/JSONParserConfiguration.java' )
72
+ def text = file. text
73
+ text = text. replaceAll(' oldCode' , ' newCode' )
74
+ file. text = text
75
+ }
76
+ }
77
+
78
+ task compileModifiedCode (type : JavaCompile ) {
79
+ source = sourceSets. main. java. srcDirs
80
+ classpath = sourceSets. main. compileClasspath
81
+ destinationDirectory = sourceSets. main. java. outputDir
82
+ }
83
+
84
+ task secondTest {
85
+
86
+ }
87
+
88
+ task restoreCode {
89
+ def file = file(' src/main/java/org/json/JSONParserConfiguration.java' )
90
+ file. text = originalFile
91
+ }
92
+
93
+ // and then add it to the task list
94
+ backupCode. finalizedBy firstTest
95
+ firstTest. finalizedBy modifyCode
96
+ modifyCode. finalizedBy compileModifiedCode
97
+ compileModifiedCode. finalizedBy secondTest
98
+ secondTest. finalizedBy restoreCode
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public class JSONParserConfiguration extends ParserConfiguration {
15
15
public JSONParserConfiguration () {
16
16
super ();
17
17
this .overwriteDuplicateKey = false ;
18
- // this.strictMode = true;
18
+ // this.strictMode = true;
19
19
}
20
20
21
21
/**
You can’t perform that action at this time.
0 commit comments