Skip to content

Commit 91fe565

Browse files
authored
Dont hardcode src in StoneTask outputDir (#533)
* dont hardcode src in StoneTask * set output dir in :core * generate stones
1 parent b004c0f commit 91fe565

File tree

11 files changed

+105
-61
lines changed

11 files changed

+105
-61
lines changed

core/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ tasks.named("generateStone", StoneTask) {
313313
),
314314

315315
])
316-
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/main"))
317-
sourceSets { main { java.srcDir(outputDir.file("src")) } }
316+
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/main/src"))
317+
sourceSets { main { java.srcDir(outputDir) } }
318318
}
319319

320320
tasks.named("generateTestStone", StoneTask) {
@@ -333,8 +333,8 @@ tasks.named("generateTestStone", StoneTask) {
333333
)
334334
),
335335
])
336-
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/test"))
337-
sourceSets { test { java.srcDir(outputDir.file("src")) } }
336+
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/test/src"))
337+
sourceSets { test { java.srcDir(outputDir) } }
338338
}
339339

340340
mavenPublishing {

core/build/generated_stone_source/main/src/com/dropbox/core/v2/fileproperties/DbxUserFilePropertiesRequests.java

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ public DbxUserFilePropertiesRequests(DbxRawClientV2 client) {
3131
/**
3232
* Add property groups to a Dropbox file. See {@link
3333
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)} or
34-
* {@code templatesAddForTeam} to create new templates.
34+
* {@link
35+
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)} to
36+
* create new templates.
3537
*
3638
*/
3739
void propertiesAdd(AddPropertiesArg arg) throws AddPropertiesErrorException, DbxException {
@@ -52,7 +54,9 @@ void propertiesAdd(AddPropertiesArg arg) throws AddPropertiesErrorException, Dbx
5254
/**
5355
* Add property groups to a Dropbox file. See {@link
5456
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)} or
55-
* {@code templatesAddForTeam} to create new templates.
57+
* {@link
58+
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)} to
59+
* create new templates.
5660
*
5761
* @param path A unique identifier for the file or folder. Must match
5862
* pattern "{@code /(.|[\\r\\n])*|id:.*|(ns:[0-9]+(/.*)?)}" and not be
@@ -135,10 +139,11 @@ public void propertiesOverwrite(String path, List<PropertyGroup> propertyGroups)
135139
* specific property field key value pairs, see {@link
136140
* DbxUserFilePropertiesRequests#propertiesUpdate(String,List)}. To update a
137141
* template, see {@link
138-
* DbxUserFilePropertiesRequests#templatesUpdateForUser(String)} or {@code
139-
* templatesUpdateForTeam}. To remove a template, see {@link
140-
* DbxUserFilePropertiesRequests#templatesRemoveForUser(String)} or {@code
141-
* templatesRemoveForTeam}.
142+
* DbxUserFilePropertiesRequests#templatesUpdateForUser(String)} or {@link
143+
* DbxTeamFilePropertiesRequests#templatesUpdateForTeam(String)}. To remove
144+
* a template, see {@link
145+
* DbxUserFilePropertiesRequests#templatesRemoveForUser(String)} or {@link
146+
* DbxTeamFilePropertiesRequests#templatesRemoveForTeam(String)}.
142147
*
143148
*/
144149
void propertiesRemove(RemovePropertiesArg arg) throws RemovePropertiesErrorException, DbxException {
@@ -161,19 +166,21 @@ void propertiesRemove(RemovePropertiesArg arg) throws RemovePropertiesErrorExcep
161166
* specific property field key value pairs, see {@link
162167
* DbxUserFilePropertiesRequests#propertiesUpdate(String,List)}. To update a
163168
* template, see {@link
164-
* DbxUserFilePropertiesRequests#templatesUpdateForUser(String)} or {@code
165-
* templatesUpdateForTeam}. To remove a template, see {@link
166-
* DbxUserFilePropertiesRequests#templatesRemoveForUser(String)} or {@code
167-
* templatesRemoveForTeam}.
169+
* DbxUserFilePropertiesRequests#templatesUpdateForUser(String)} or {@link
170+
* DbxTeamFilePropertiesRequests#templatesUpdateForTeam(String)}. To remove
171+
* a template, see {@link
172+
* DbxUserFilePropertiesRequests#templatesRemoveForUser(String)} or {@link
173+
* DbxTeamFilePropertiesRequests#templatesRemoveForTeam(String)}.
168174
*
169175
* @param path A unique identifier for the file or folder. Must match
170176
* pattern "{@code /(.|[\\r\\n])*|id:.*|(ns:[0-9]+(/.*)?)}" and not be
171177
* {@code null}.
172178
* @param propertyTemplateIds A list of identifiers for a template created
173179
* by {@link
174180
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
175-
* or {@code templatesAddForTeam}. Must not contain a {@code null} item
176-
* and not be {@code null}.
181+
* or {@link
182+
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
183+
* Must not contain a {@code null} item and not be {@code null}.
177184
*
178185
* @throws IllegalArgumentException If any argument does not meet its
179186
* preconditions.
@@ -419,8 +426,10 @@ GetTemplateResult templatesGetForUser(GetTemplateArg arg) throws TemplateErrorEx
419426
*
420427
* @param templateId An identifier for template added by route See {@link
421428
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
422-
* or {@code templatesAddForTeam}. Must have length of at least 1, match
423-
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
429+
* or {@link
430+
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
431+
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
432+
* and not be {@code null}.
424433
*
425434
* @throws IllegalArgumentException If any argument does not meet its
426435
* preconditions.
@@ -489,8 +498,10 @@ void templatesRemoveForUser(RemoveTemplateArg arg) throws TemplateErrorException
489498
*
490499
* @param templateId An identifier for a template created by {@link
491500
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
492-
* or {@code templatesAddForTeam}. Must have length of at least 1, match
493-
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
501+
* or {@link
502+
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
503+
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
504+
* and not be {@code null}.
494505
*
495506
* @throws IllegalArgumentException If any argument does not meet its
496507
* preconditions.
@@ -534,8 +545,10 @@ UpdateTemplateResult templatesUpdateForUser(UpdateTemplateArg arg) throws Modify
534545
*
535546
* @param templateId An identifier for template added by See {@link
536547
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
537-
* or {@code templatesAddForTeam}. Must have length of at least 1, match
538-
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
548+
* or {@link
549+
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
550+
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
551+
* and not be {@code null}.
539552
*
540553
* @throws IllegalArgumentException If any argument does not meet its
541554
* preconditions.
@@ -553,8 +566,10 @@ public UpdateTemplateResult templatesUpdateForUser(String templateId) throws Mod
553566
*
554567
* @param templateId An identifier for template added by See {@link
555568
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
556-
* or {@code templatesAddForTeam}. Must have length of at least 1, match
557-
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
569+
* or {@link
570+
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
571+
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
572+
* and not be {@code null}.
558573
*
559574
* @return Request builder for configuring request parameters and completing
560575
* the request.

core/build/generated_stone_source/main/src/com/dropbox/core/v2/fileproperties/RemovePropertiesArg.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ public class RemovePropertiesArg {
3636
* @param propertyTemplateIds A list of identifiers for a template created
3737
* by {@link
3838
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
39-
* or {@code templatesAddForTeam}. Must not contain a {@code null} item
40-
* and not be {@code null}.
39+
* or {@link
40+
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
41+
* Must not contain a {@code null} item and not be {@code null}.
4142
*
4243
* @throws IllegalArgumentException If any argument does not meet its
4344
* preconditions.
@@ -80,7 +81,8 @@ public String getPath() {
8081
/**
8182
* A list of identifiers for a template created by {@link
8283
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)} or
83-
* {@code templatesAddForTeam}.
84+
* {@link
85+
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
8486
*
8587
* @return value for this field, never {@code null}.
8688
*/

core/build/generated_stone_source/main/src/com/dropbox/core/v2/files/DbxUserFilesRequests.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3416,8 +3416,9 @@ void propertiesRemove(RemovePropertiesArg arg) throws RemovePropertiesErrorExcep
34163416
* @param propertyTemplateIds A list of identifiers for a template created
34173417
* by {@link
34183418
* com.dropbox.core.v2.fileproperties.DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
3419-
* or {@code templatesAddForTeam}. Must not contain a {@code null} item
3420-
* and not be {@code null}.
3419+
* or {@link
3420+
* com.dropbox.core.v2.fileproperties.DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
3421+
* Must not contain a {@code null} item and not be {@code null}.
34213422
*
34223423
* @throws IllegalArgumentException If any argument does not meet its
34233424
* preconditions.
@@ -3456,8 +3457,10 @@ GetTemplateResult propertiesTemplateGet(GetTemplateArg arg) throws TemplateError
34563457
*
34573458
* @param templateId An identifier for template added by route See {@link
34583459
* com.dropbox.core.v2.fileproperties.DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
3459-
* or {@code templatesAddForTeam}. Must have length of at least 1, match
3460-
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
3460+
* or {@link
3461+
* com.dropbox.core.v2.fileproperties.DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
3462+
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
3463+
* and not be {@code null}.
34613464
*
34623465
* @throws IllegalArgumentException If any argument does not meet its
34633466
* preconditions.

core/build/generated_stone_source/test/src/com/dropbox/core/stone/test/Cat.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818
import java.util.Arrays;
1919
import java.util.Date;
2020

21+
import javax.annotation.Nonnull;
22+
import javax.annotation.Nullable;
23+
2124
public class Cat extends Pet {
2225
// struct test.Cat (test.stone)
2326

27+
@Nullable
2428
protected final String breed;
29+
@Nullable
2530
protected final Boolean indoor;
2631

2732
/**
@@ -35,7 +40,7 @@ public class Cat extends Pet {
3540
* @throws IllegalArgumentException If any argument does not meet its
3641
* preconditions.
3742
*/
38-
public Cat(String name, Date born, String breed, Boolean indoor) {
43+
public Cat(@Nonnull String name, @Nullable Date born, @Nullable String breed, @Nullable Boolean indoor) {
3944
super(name, born);
4045
this.breed = breed;
4146
this.indoor = indoor;
@@ -53,7 +58,7 @@ public Cat(String name, Date born, String breed, Boolean indoor) {
5358
* @throws IllegalArgumentException If any argument does not meet its
5459
* preconditions.
5560
*/
56-
public Cat(String name) {
61+
public Cat(@Nonnull String name) {
5762
this(name, null, null, null);
5863
}
5964

@@ -62,7 +67,7 @@ public Cat(String name) {
6267
*
6368
* @return value for this field, never {@code null}.
6469
*/
65-
@javax.annotation.Nonnull
70+
@Nonnull
6671
public String getName() {
6772
return name;
6873
}
@@ -71,7 +76,7 @@ public String getName() {
7176
*
7277
* @return value for this field, or {@code null} if not present.
7378
*/
74-
@javax.annotation.Nullable
79+
@Nullable
7580
public Date getBorn() {
7681
return born;
7782
}
@@ -80,7 +85,7 @@ public Date getBorn() {
8085
*
8186
* @return value for this field, or {@code null} if not present.
8287
*/
83-
@javax.annotation.Nullable
88+
@Nullable
8489
public String getBreed() {
8590
return breed;
8691
}
@@ -89,7 +94,7 @@ public String getBreed() {
8994
*
9095
* @return value for this field, or {@code null} if not present.
9196
*/
92-
@javax.annotation.Nullable
97+
@Nullable
9398
public Boolean getIndoor() {
9499
return indoor;
95100
}

core/build/generated_stone_source/test/src/com/dropbox/core/stone/test/Dog.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818
import java.util.Arrays;
1919
import java.util.Date;
2020

21+
import javax.annotation.Nonnull;
22+
import javax.annotation.Nullable;
23+
2124
public class Dog extends Pet {
2225
// struct test.Dog (test.stone)
2326

27+
@Nonnull
2428
protected final String breed;
29+
@Nullable
2530
protected final DogSize size;
2631

2732
/**
@@ -36,7 +41,7 @@ public class Dog extends Pet {
3641
* @throws IllegalArgumentException If any argument does not meet its
3742
* preconditions.
3843
*/
39-
public Dog(String name, String breed, Date born, DogSize size) {
44+
public Dog(@Nonnull String name, @Nonnull String breed, @Nullable Date born, @Nullable DogSize size) {
4045
super(name, born);
4146
if (breed == null) {
4247
throw new IllegalArgumentException("Required value for 'breed' is null");
@@ -58,7 +63,7 @@ public Dog(String name, String breed, Date born, DogSize size) {
5863
* @throws IllegalArgumentException If any argument does not meet its
5964
* preconditions.
6065
*/
61-
public Dog(String name, String breed) {
66+
public Dog(@Nonnull String name, @Nonnull String breed) {
6267
this(name, breed, null, null);
6368
}
6469

@@ -67,7 +72,7 @@ public Dog(String name, String breed) {
6772
*
6873
* @return value for this field, never {@code null}.
6974
*/
70-
@javax.annotation.Nonnull
75+
@Nonnull
7176
public String getName() {
7277
return name;
7378
}
@@ -76,7 +81,7 @@ public String getName() {
7681
*
7782
* @return value for this field, never {@code null}.
7883
*/
79-
@javax.annotation.Nonnull
84+
@Nonnull
8085
public String getBreed() {
8186
return breed;
8287
}
@@ -85,7 +90,7 @@ public String getBreed() {
8590
*
8691
* @return value for this field, or {@code null} if not present.
8792
*/
88-
@javax.annotation.Nullable
93+
@Nullable
8994
public Date getBorn() {
9095
return born;
9196
}
@@ -94,7 +99,7 @@ public Date getBorn() {
9499
*
95100
* @return value for this field, or {@code null} if not present.
96101
*/
97-
@javax.annotation.Nullable
102+
@Nullable
98103
public DogSize getSize() {
99104
return size;
100105
}

core/build/generated_stone_source/test/src/com/dropbox/core/stone/test/Fish.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818
import java.util.Arrays;
1919
import java.util.Date;
2020

21+
import javax.annotation.Nonnull;
22+
import javax.annotation.Nullable;
23+
2124
public class Fish extends Pet {
2225
// struct test.Fish (test.stone)
2326

27+
@Nonnull
2428
protected final String species;
29+
@Nonnull
2530
protected final TankSize tankSize;
2631

2732
/**
@@ -35,7 +40,7 @@ public class Fish extends Pet {
3540
* @throws IllegalArgumentException If any argument does not meet its
3641
* preconditions.
3742
*/
38-
public Fish(String name, String species, TankSize tankSize, Date born) {
43+
public Fish(@Nonnull String name, @Nonnull String species, @Nonnull TankSize tankSize, @Nullable Date born) {
3944
super(name, born);
4045
if (species == null) {
4146
throw new IllegalArgumentException("Required value for 'species' is null");
@@ -61,7 +66,7 @@ public Fish(String name, String species, TankSize tankSize, Date born) {
6166
* @throws IllegalArgumentException If any argument does not meet its
6267
* preconditions.
6368
*/
64-
public Fish(String name, String species, TankSize tankSize) {
69+
public Fish(@Nonnull String name, @Nonnull String species, @Nonnull TankSize tankSize) {
6570
this(name, species, tankSize, null);
6671
}
6772

@@ -70,7 +75,7 @@ public Fish(String name, String species, TankSize tankSize) {
7075
*
7176
* @return value for this field, never {@code null}.
7277
*/
73-
@javax.annotation.Nonnull
78+
@Nonnull
7479
public String getName() {
7580
return name;
7681
}
@@ -79,7 +84,7 @@ public String getName() {
7984
*
8085
* @return value for this field, never {@code null}.
8186
*/
82-
@javax.annotation.Nonnull
87+
@Nonnull
8388
public String getSpecies() {
8489
return species;
8590
}
@@ -88,7 +93,7 @@ public String getSpecies() {
8893
*
8994
* @return value for this field, never {@code null}.
9095
*/
91-
@javax.annotation.Nonnull
96+
@Nonnull
9297
public TankSize getTankSize() {
9398
return tankSize;
9499
}
@@ -97,7 +102,7 @@ public TankSize getTankSize() {
97102
*
98103
* @return value for this field, or {@code null} if not present.
99104
*/
100-
@javax.annotation.Nullable
105+
@Nullable
101106
public Date getBorn() {
102107
return born;
103108
}

0 commit comments

Comments
 (0)