Skip to content

Commit 8b3c686

Browse files
sebersolebeikov
authored andcommitted
HHH-16962 - General documentation improvements
https://hibernate.atlassian.net/browse/HHH-16962 (cherry picked from commit a6eefb0)
1 parent 4186ca2 commit 8b3c686

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

local-build-plugins/src/main/java/org/hibernate/orm/docs/DocumentationPublishing.java

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public class DocumentationPublishing {
2929

3030
private final DirectoryProperty stagingDirectory;
3131
private final Property<String> docServerUrl;
32-
private final Property<String> docDescriptorServerUrl;
3332

33+
private final Property<String> docDescriptorUploadUrl;
3434
private final RegularFileProperty updatedJsonFile;
3535

3636
private final ReleaseFamilyIdentifier releaseFamilyIdentifier;
@@ -42,13 +42,14 @@ public DocumentationPublishing(Project project) {
4242
stagingDirectory = project.getObjects()
4343
.directoryProperty()
4444
.convention( project.getLayout().getBuildDirectory().dir( "documentation" ) );
45+
4546
docServerUrl = project.getObjects()
4647
.property( String.class )
4748
.convention( "filemgmt-prod-sync.jboss.org:/docs_htdocs/hibernate/orm" );
4849

49-
docDescriptorServerUrl = project.getObjects()
50+
docDescriptorUploadUrl = project.getObjects()
5051
.property( String.class )
51-
.convention( "filemgmt-prod-sync.jboss.org:/docs_htdocs/hibernate" );
52+
.convention( "filemgmt-prod-sync.jboss.org:/docs_htdocs/hibernate/_outdated-content/orm.json" );
5253

5354

5455
updatedJsonFile = project.getObjects()
@@ -62,22 +63,28 @@ public ReleaseFamilyIdentifier getReleaseFamilyIdentifier() {
6263
return releaseFamilyIdentifier;
6364
}
6465

65-
public Provider<RegularFile> getUpdatedJsonFile() {
66-
return updatedJsonFile;
67-
}
68-
6966
public Property<String> getDocServerUrl() {
7067
return docServerUrl;
7168
}
7269

73-
public Property<String> getDocDescriptorServerUrl() {
74-
return docDescriptorServerUrl;
75-
}
76-
7770
public DirectoryProperty getStagingDirectory() {
7871
return stagingDirectory;
7972
}
8073

74+
/**
75+
* Where to upload the {@link #getUpdatedJsonFile() documentation descriptor}
76+
*/
77+
public Property<String> getDocDescriptorUploadUrl() {
78+
return docDescriptorUploadUrl;
79+
}
80+
81+
/**
82+
* THe ORM documentation descriptor
83+
*/
84+
public Provider<RegularFile> getUpdatedJsonFile() {
85+
return updatedJsonFile;
86+
}
87+
8188
public void setUpdatedJsonFile(Object ref) {
8289
updatedJsonFile.fileValue( project.file( ref ) );
8390
}

local-build-plugins/src/main/java/org/hibernate/orm/docs/DocumentationPublishingPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void apply(Project project) {
4545
UPLOAD_DESC_TASK_NAME,
4646
PublishDescriptorTask.class,
4747
(task) -> {
48-
task.getDocServerUrl().convention( docPubDsl.getDocServerUrl() );
48+
task.getDocDescriptorUploadUrl().convention( docPubDsl.getDocDescriptorUploadUrl() );
4949
task.getJsonFile().convention( docPubDsl.getUpdatedJsonFile() );
5050

5151
task.dependsOn( generateDescriptorTask );

local-build-plugins/src/main/java/org/hibernate/orm/docs/PublishDescriptorTask.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ public abstract class PublishDescriptorTask extends DefaultTask {
2222
public static final String UPLOAD_DESC_TASK_NAME = "uploadDocumentationDescriptor";
2323

2424
private final Provider<Object> projectVersion;
25-
private final Property<String> docServerUrl;
25+
private final Property<String> docDescriptorUploadUrl;
2626
private final RegularFileProperty jsonFile;
2727

2828
public PublishDescriptorTask() {
2929
setGroup( "documentation" );
3030
setDescription( "Publishes the documentation publication descriptor (JSON)" );
3131

3232
projectVersion = getProject().provider( () -> getProject().getVersion() );
33-
docServerUrl = getProject().getObjects().property( String.class );
33+
docDescriptorUploadUrl = getProject().getObjects().property( String.class );
3434
jsonFile = getProject().getObjects().fileProperty();
3535
}
3636

@@ -41,8 +41,8 @@ public RegularFileProperty getJsonFile() {
4141
}
4242

4343
@Input
44-
public Property<String> getDocServerUrl() {
45-
return docServerUrl;
44+
public Property<String> getDocDescriptorUploadUrl() {
45+
return docDescriptorUploadUrl;
4646
}
4747

4848
@Input
@@ -53,10 +53,7 @@ public Provider<Object> getProjectVersion() {
5353

5454
@TaskAction
5555
public void uploadDescriptor() {
56-
final String base = docServerUrl.get();
57-
final String normalizedBase = base.endsWith( "/" ) ? base : base + "/";
58-
final String url = normalizedBase + "_outdated-content/orm.json";
59-
56+
final String url = docDescriptorUploadUrl.get();
6057
RsyncHelper.rsync( jsonFile.get(), url, getProject() );
6158
}
6259
}

0 commit comments

Comments
 (0)