Skip to content

Commit f7a3b48

Browse files
authored
Update Javadoc Linking and Groups (Azure#20058)
Added missing Javadoc links, parallelized build and deploy job, and updated test jobs
1 parent 78de451 commit f7a3b48

File tree

10 files changed

+113
-169
lines changed

10 files changed

+113
-169
lines changed

eng/pipelines/scripts/inject_codesnippets.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def finalize_snippet(self, key):
6060

6161

6262
def re_space_snippet(snippet_list):
63-
# find identation (or whitespace characters) on the left side
63+
# find indentation (or whitespace characters) on the left side
6464
white_space = [
6565
re.match(WHITESPACE_EXTRACTION, line).groupdict()["leadingspace"]
6666
for line in snippet_list
@@ -74,25 +74,28 @@ def re_space_snippet(snippet_list):
7474
return [line.replace(white_space_for_replacement, "", 1) for line in snippet_list]
7575

7676

77-
def get_snippets_from_file(file):
77+
def get_snippets_from_file(file, verbose):
7878
finished_snippets = {}
7979
running_dict = SnippetDict()
8080

8181
with open(file, "r", encoding="utf-8") as source:
82-
print(file)
82+
if verbose:
83+
print(file)
8384
for line in source.readlines():
8485

8586
begin = re.match(SNIPPET_BEGIN, line)
8687
end = re.match(SNIPPET_END, line)
8788

8889
if begin:
8990
id_beginning = begin.groupdict()["id"]
90-
print("beginning {}".format(id_beginning))
91+
if verbose:
92+
print("beginning {}".format(id_beginning))
9193
running_dict.begin_snippet(id_beginning)
9294
elif end:
9395
id_ending = end.groupdict()["id"]
9496
ending = running_dict.finalize_snippet(id_ending)
95-
print("ending {}".format(id_ending))
97+
if verbose:
98+
print("ending {}".format(id_ending))
9699
finished_snippets[id_ending] = ending
97100
elif running_dict:
98101
running_dict.process_line(line)
@@ -118,6 +121,14 @@ def check_exclusion(file_name, exclusion_array):
118121
help="The path to the directory containing our package or service. Essentially used as a scoping mechanism for the replacement of the snippets.",
119122
required=True,
120123
)
124+
parser.add_argument(
125+
"--verbose",
126+
"-v",
127+
dest="verbose",
128+
help="Flag indicating if verbose, debug level, output should be printed.",
129+
required=False,
130+
default=False
131+
)
121132
args = parser.parse_args()
122133

123134
# walk the codebase, find all java files
@@ -132,7 +143,7 @@ def check_exclusion(file_name, exclusion_array):
132143
snippets = {}
133144

134145
for file in snippet_files:
135-
snippet_dict = get_snippets_from_file(file)
146+
snippet_dict = get_snippets_from_file(file, args.verbose)
136147
snippets.update(snippet_dict)
137148

138149
for file in all_files:
@@ -174,4 +185,3 @@ def check_exclusion(file_name, exclusion_array):
174185
with open(file, "w", encoding="utf-8") as out_file:
175186
for line in amended_file:
176187
out_file.write(line)
177-

eng/pipelines/templates/jobs/ci.tests.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ parameters:
1717
- name: PreTestSteps
1818
type: object
1919
default: []
20+
- name: BuildOptions
21+
type: string
22+
default: '$(DefaultOptions) -T 1C -DskipTests -Dgpg.skip -DtrimStackTrace=false -Dmaven.javadoc.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -Djacoco.skip=true'
2023
- name: TestOptions
2124
type: string
2225
default: '$(DefaultOptions) -DtrimStackTrace=false -Dmaven.javadoc.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -Dparallel-test-playback'
23-
- name: TestGoals
24-
type: string
25-
default: verify
2626
- name: Matrix
2727
type: object
2828
- name: CloudConfig
@@ -106,17 +106,31 @@ jobs:
106106
arguments: '--project-list $(ProjectList)'
107107
condition: and(succeeded(), eq(variables['ShouldRunSourceTests'],'true'))
108108

109+
- task: Maven@3
110+
displayName: 'Build for non-From Source run'
111+
inputs:
112+
mavenPomFile: pom.xml
113+
options: ${{ parameters.BuildOptions }} -pl $(PLSkipOptions)$(ProjectList) -am
114+
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
115+
javaHomeOption: 'JDKVersion'
116+
jdkVersionOption: $(JavaTestVersion)
117+
jdkArchitectureOption: 'x64'
118+
publishJUnitResults: false
119+
goals: 'install'
120+
# we want to run this when we aren't running from source and aren't generating Jacoco test coverage
121+
condition: and(succeeded(), ne(variables['TestFromSource'], 'true'), not(and(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['JavaTestVersion'], '1.11'), eq('${{ parameters.SDKType }}', 'client'))))
122+
109123
- task: Maven@3
110124
displayName: 'Run tests'
111125
inputs:
112126
mavenPomFile: pom.xml
113-
options: ${{ parameters.TestOptions }} -pl $(PLSkipOptions)$(ProjectList) -am $(AdditionalOptions)
127+
options: ${{ parameters.TestOptions }} -pl $(PLSkipOptions)$(ProjectList) $(AdditionalOptions)
114128
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
115129
javaHomeOption: 'JDKVersion'
116130
jdkVersionOption: $(JavaTestVersion)
117131
jdkArchitectureOption: 'x64'
118132
publishJUnitResults: false
119-
goals: ${{ parameters.TestGoals }}
133+
goals: $(TestGoals)
120134
# we want to run this when TestFromSource isn't true
121135
condition: and(succeeded(), ne(variables['TestFromSource'],'true'))
122136

@@ -146,7 +160,7 @@ jobs:
146160
# dependency. Note: The -T 1C says spin up a build thread per core. Since we're building
147161
# all of the track 2, client, libraries (which is now over 100) this effectively cuts the
148162
# the build time in half.
149-
options: '$(DefaultOptions) -T 1C -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true'
163+
options: ${{ parameters.BuildOptions }}
150164
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
151165
javaHomeOption: 'JDKVersion'
152166
jdkVersionOption: $(JavaBuildVersion)
@@ -170,7 +184,7 @@ jobs:
170184
# as well as libraries which depend on them and not the other stages in the Maven
171185
# lifecycle that test or verify targets would execute. The libraries were already
172186
# compiled and installed in the previous task, this tasks only runs tests.
173-
goals: 'surefire:test'
187+
goals: $(TestGoals)
174188
condition: and(succeeded(), and(eq(variables['TestFromSource'],'true'), eq(variables['ShouldRunSourceTests'],'true')))
175189

176190
- template: ../steps/upload-repository-on-failure.yml

eng/pipelines/templates/jobs/ci.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ parameters:
1717
- name: PreTestSteps
1818
type: object
1919
default: []
20-
- name: TestOptions
21-
type: string
22-
default: '$(DefaultOptions) -DtrimStackTrace=false -Dmaven.javadoc.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -Dparallel-test-playback'
23-
- name: TestGoals
24-
type: string
25-
default: verify
2620
- name: MatrixConfigs
2721
type: object
2822
- name: AdditionalMatrixConfigs
@@ -105,11 +99,11 @@ jobs:
10599
AdditionalModules: ${{parameters.AdditionalModules}}
106100

107101
- task: Maven@3
108-
displayName: 'Build and Package , JDK Version: $(JavaBuildVersion)'
102+
displayName: 'Build and Package, JDK Version: $(JavaBuildVersion)'
109103
inputs:
110104
mavenPomFile: pom.xml
111105
goals: 'deploy'
112-
options: '$(DefaultOptions) -DskipTests -Dinject-codesnippets -Dgenerate-overview -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -pl $(ProjectList) -am -DaltDeploymentRepository=id::default::file://$(System.DefaultWorkingDirectory)/build' # We include template-module so we ensure it always builds in CI
106+
options: '$(DefaultOptions) -T 1C -DskipTests -Dinject-codesnippets -Dgenerate-overview -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -pl $(ProjectList) -am -DaltDeploymentRepository=id::default::file://$(System.DefaultWorkingDirectory)/build' # We include template-module so we ensure it always builds in CI
113107
mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
114108
javaHomeOption: 'JDKVersion'
115109
jdkVersionOption: $(JavaBuildVersion)
@@ -242,5 +236,3 @@ jobs:
242236
Artifacts: ${{ parameters.Artifacts }}
243237
AdditionalModules: ${{ parameters.AdditionalModules }}
244238
PreTestSteps: ${{ parameters.PreTestSteps }}
245-
TestOptions: ${{ parameters.TestOptions }}
246-
TestGoals: ${{ parameters.TestGoals }}

eng/pipelines/templates/stages/platform-matrix.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@
1010
},
1111
"JavaTestVersion": [ "1.8", "1.11" ],
1212
"AZURE_TEST_HTTP_CLIENTS": [ "okhttp", "netty" ],
13+
"TestGoals": "surefire:test",
1314
"TestOptions": ""
1415
},
16+
"exclude": [
17+
{
18+
"Pool": "azsdk-pool-mms-win-2019-general",
19+
"JavaTestVersion": "1.11"
20+
}
21+
],
1522
"include": [
1623
{
1724
"Agent": {
@@ -20,6 +27,16 @@
2027
"JavaTestVersion": "1.11",
2128
"AZURE_TEST_HTTP_CLIENTS": "netty",
2229
"TestFromSource": true,
30+
"TestGoals": "surefire:test",
31+
"TestOptions": ""
32+
},
33+
{
34+
"Agent": {
35+
"windows-2019": { "OSVmImage": "MMS2019", "Pool": "azsdk-pool-mms-win-2019-general" }
36+
},
37+
"JavaTestVersion": "1.11",
38+
"AZURE_TEST_HTTP_CLIENTS": "netty",
39+
"TestGoals": "verify",
2340
"TestOptions": ""
2441
}
2542
]

sdk/core/azure-core-http-netty/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,19 @@
199199
</configuration>
200200
</plugin>
201201

202+
<!-- This plugin generates Javadocs -->
203+
<plugin>
204+
<groupId>org.apache.maven.plugins</groupId>
205+
<artifactId>maven-javadoc-plugin</artifactId>
206+
<version>3.1.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-javadoc-plugin;external_dependency} -->
207+
<configuration>
208+
<links>
209+
<link>https://netty.io/4.1/api/</link>
210+
<link>https://projectreactor.io/docs/netty/release/api/</link>
211+
</links>
212+
</configuration>
213+
</plugin>
214+
202215
<plugin>
203216
<groupId>org.apache.maven.plugins</groupId>
204217
<artifactId>maven-compiler-plugin</artifactId>

sdk/core/azure-core-serializer-avro-apache/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@
115115
</configuration>
116116
</plugin>
117117

118+
<!-- This plugin generates Javadocs -->
119+
<plugin>
120+
<groupId>org.apache.maven.plugins</groupId>
121+
<artifactId>maven-javadoc-plugin</artifactId>
122+
<version>3.1.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-javadoc-plugin;external_dependency} -->
123+
<configuration>
124+
<links>
125+
<link>https://avro.apache.org/docs/current/api/java/</link>
126+
</links>
127+
</configuration>
128+
</plugin>
129+
118130
<plugin>
119131
<groupId>org.apache.avro</groupId>
120132
<artifactId>avro-maven-plugin</artifactId>

sdk/core/azure-core-serializer-json-jackson/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@
105105
</compilerArgs>
106106
</configuration>
107107
</plugin>
108+
109+
<!-- This plugin generates Javadocs -->
110+
<plugin>
111+
<groupId>org.apache.maven.plugins</groupId>
112+
<artifactId>maven-javadoc-plugin</artifactId>
113+
<version>3.1.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-javadoc-plugin;external_dependency} -->
114+
<configuration>
115+
<links>
116+
<link>https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/latest/</link>
117+
<link>https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/latest/</link>
118+
<link>https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/latest/</link>
119+
</links>
120+
</configuration>
121+
</plugin>
108122
</plugins>
109123
</build>
110124

sdk/core/azure-core/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,20 @@
202202
</configuration>
203203
</plugin>
204204

205+
<!-- This plugin generates Javadocs -->
206+
<plugin>
207+
<groupId>org.apache.maven.plugins</groupId>
208+
<artifactId>maven-javadoc-plugin</artifactId>
209+
<version>3.1.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-javadoc-plugin;external_dependency} -->
210+
<configuration>
211+
<links>
212+
<link>https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/latest/</link>
213+
<link>https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/latest/</link>
214+
<link>https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/latest/</link>
215+
</links>
216+
</configuration>
217+
</plugin>
218+
205219
<!-- This plugin scans reports spotbugs in the code -->
206220
<plugin>
207221
<groupId>com.github.spotbugs</groupId>

0 commit comments

Comments
 (0)