Skip to content

Commit

Permalink
Dont hardcode src in StoneTask outputDir (#533)
Browse files Browse the repository at this point in the history
* dont hardcode src in StoneTask

* set output dir in :core

* generate stones
  • Loading branch information
devPalacio authored Mar 21, 2024
1 parent b004c0f commit 91fe565
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 61 deletions.
8 changes: 4 additions & 4 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ tasks.named("generateStone", StoneTask) {
),

])
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/main"))
sourceSets { main { java.srcDir(outputDir.file("src")) } }
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/main/src"))
sourceSets { main { java.srcDir(outputDir) } }
}

tasks.named("generateTestStone", StoneTask) {
Expand All @@ -333,8 +333,8 @@ tasks.named("generateTestStone", StoneTask) {
)
),
])
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/test"))
sourceSets { test { java.srcDir(outputDir.file("src")) } }
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/test/src"))
sourceSets { test { java.srcDir(outputDir) } }
}

mavenPublishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public DbxUserFilePropertiesRequests(DbxRawClientV2 client) {
/**
* Add property groups to a Dropbox file. See {@link
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)} or
* {@code templatesAddForTeam} to create new templates.
* {@link
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)} to
* create new templates.
*
*/
void propertiesAdd(AddPropertiesArg arg) throws AddPropertiesErrorException, DbxException {
Expand All @@ -52,7 +54,9 @@ void propertiesAdd(AddPropertiesArg arg) throws AddPropertiesErrorException, Dbx
/**
* Add property groups to a Dropbox file. See {@link
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)} or
* {@code templatesAddForTeam} to create new templates.
* {@link
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)} to
* create new templates.
*
* @param path A unique identifier for the file or folder. Must match
* pattern "{@code /(.|[\\r\\n])*|id:.*|(ns:[0-9]+(/.*)?)}" and not be
Expand Down Expand Up @@ -135,10 +139,11 @@ public void propertiesOverwrite(String path, List<PropertyGroup> propertyGroups)
* specific property field key value pairs, see {@link
* DbxUserFilePropertiesRequests#propertiesUpdate(String,List)}. To update a
* template, see {@link
* DbxUserFilePropertiesRequests#templatesUpdateForUser(String)} or {@code
* templatesUpdateForTeam}. To remove a template, see {@link
* DbxUserFilePropertiesRequests#templatesRemoveForUser(String)} or {@code
* templatesRemoveForTeam}.
* DbxUserFilePropertiesRequests#templatesUpdateForUser(String)} or {@link
* DbxTeamFilePropertiesRequests#templatesUpdateForTeam(String)}. To remove
* a template, see {@link
* DbxUserFilePropertiesRequests#templatesRemoveForUser(String)} or {@link
* DbxTeamFilePropertiesRequests#templatesRemoveForTeam(String)}.
*
*/
void propertiesRemove(RemovePropertiesArg arg) throws RemovePropertiesErrorException, DbxException {
Expand All @@ -161,19 +166,21 @@ void propertiesRemove(RemovePropertiesArg arg) throws RemovePropertiesErrorExcep
* specific property field key value pairs, see {@link
* DbxUserFilePropertiesRequests#propertiesUpdate(String,List)}. To update a
* template, see {@link
* DbxUserFilePropertiesRequests#templatesUpdateForUser(String)} or {@code
* templatesUpdateForTeam}. To remove a template, see {@link
* DbxUserFilePropertiesRequests#templatesRemoveForUser(String)} or {@code
* templatesRemoveForTeam}.
* DbxUserFilePropertiesRequests#templatesUpdateForUser(String)} or {@link
* DbxTeamFilePropertiesRequests#templatesUpdateForTeam(String)}. To remove
* a template, see {@link
* DbxUserFilePropertiesRequests#templatesRemoveForUser(String)} or {@link
* DbxTeamFilePropertiesRequests#templatesRemoveForTeam(String)}.
*
* @param path A unique identifier for the file or folder. Must match
* pattern "{@code /(.|[\\r\\n])*|id:.*|(ns:[0-9]+(/.*)?)}" and not be
* {@code null}.
* @param propertyTemplateIds A list of identifiers for a template created
* by {@link
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
* or {@code templatesAddForTeam}. Must not contain a {@code null} item
* and not be {@code null}.
* or {@link
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
* Must not contain a {@code null} item and not be {@code null}.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
Expand Down Expand Up @@ -419,8 +426,10 @@ GetTemplateResult templatesGetForUser(GetTemplateArg arg) throws TemplateErrorEx
*
* @param templateId An identifier for template added by route See {@link
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
* or {@code templatesAddForTeam}. Must have length of at least 1, match
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
* or {@link
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
* and not be {@code null}.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
Expand Down Expand Up @@ -489,8 +498,10 @@ void templatesRemoveForUser(RemoveTemplateArg arg) throws TemplateErrorException
*
* @param templateId An identifier for a template created by {@link
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
* or {@code templatesAddForTeam}. Must have length of at least 1, match
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
* or {@link
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
* and not be {@code null}.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
Expand Down Expand Up @@ -534,8 +545,10 @@ UpdateTemplateResult templatesUpdateForUser(UpdateTemplateArg arg) throws Modify
*
* @param templateId An identifier for template added by See {@link
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
* or {@code templatesAddForTeam}. Must have length of at least 1, match
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
* or {@link
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
* and not be {@code null}.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
Expand All @@ -553,8 +566,10 @@ public UpdateTemplateResult templatesUpdateForUser(String templateId) throws Mod
*
* @param templateId An identifier for template added by See {@link
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
* or {@code templatesAddForTeam}. Must have length of at least 1, match
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
* or {@link
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
* and not be {@code null}.
*
* @return Request builder for configuring request parameters and completing
* the request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ public class RemovePropertiesArg {
* @param propertyTemplateIds A list of identifiers for a template created
* by {@link
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
* or {@code templatesAddForTeam}. Must not contain a {@code null} item
* and not be {@code null}.
* or {@link
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
* Must not contain a {@code null} item and not be {@code null}.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
Expand Down Expand Up @@ -80,7 +81,8 @@ public String getPath() {
/**
* A list of identifiers for a template created by {@link
* DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)} or
* {@code templatesAddForTeam}.
* {@link
* DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
*
* @return value for this field, never {@code null}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3416,8 +3416,9 @@ void propertiesRemove(RemovePropertiesArg arg) throws RemovePropertiesErrorExcep
* @param propertyTemplateIds A list of identifiers for a template created
* by {@link
* com.dropbox.core.v2.fileproperties.DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
* or {@code templatesAddForTeam}. Must not contain a {@code null} item
* and not be {@code null}.
* or {@link
* com.dropbox.core.v2.fileproperties.DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
* Must not contain a {@code null} item and not be {@code null}.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
Expand Down Expand Up @@ -3456,8 +3457,10 @@ GetTemplateResult propertiesTemplateGet(GetTemplateArg arg) throws TemplateError
*
* @param templateId An identifier for template added by route See {@link
* com.dropbox.core.v2.fileproperties.DbxUserFilePropertiesRequests#templatesAddForUser(String,String,List)}
* or {@code templatesAddForTeam}. Must have length of at least 1, match
* pattern "{@code (/|ptid:).*}", and not be {@code null}.
* or {@link
* com.dropbox.core.v2.fileproperties.DbxTeamFilePropertiesRequests#templatesAddForTeam(String,String,List)}.
* Must have length of at least 1, match pattern "{@code (/|ptid:).*}",
* and not be {@code null}.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
import java.util.Arrays;
import java.util.Date;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class Cat extends Pet {
// struct test.Cat (test.stone)

@Nullable
protected final String breed;
@Nullable
protected final Boolean indoor;

/**
Expand All @@ -35,7 +40,7 @@ public class Cat extends Pet {
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public Cat(String name, Date born, String breed, Boolean indoor) {
public Cat(@Nonnull String name, @Nullable Date born, @Nullable String breed, @Nullable Boolean indoor) {
super(name, born);
this.breed = breed;
this.indoor = indoor;
Expand All @@ -53,7 +58,7 @@ public Cat(String name, Date born, String breed, Boolean indoor) {
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public Cat(String name) {
public Cat(@Nonnull String name) {
this(name, null, null, null);
}

Expand All @@ -62,7 +67,7 @@ public Cat(String name) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
@Nonnull
public String getName() {
return name;
}
Expand All @@ -71,7 +76,7 @@ public String getName() {
*
* @return value for this field, or {@code null} if not present.
*/
@javax.annotation.Nullable
@Nullable
public Date getBorn() {
return born;
}
Expand All @@ -80,7 +85,7 @@ public Date getBorn() {
*
* @return value for this field, or {@code null} if not present.
*/
@javax.annotation.Nullable
@Nullable
public String getBreed() {
return breed;
}
Expand All @@ -89,7 +94,7 @@ public String getBreed() {
*
* @return value for this field, or {@code null} if not present.
*/
@javax.annotation.Nullable
@Nullable
public Boolean getIndoor() {
return indoor;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
import java.util.Arrays;
import java.util.Date;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class Dog extends Pet {
// struct test.Dog (test.stone)

@Nonnull
protected final String breed;
@Nullable
protected final DogSize size;

/**
Expand All @@ -36,7 +41,7 @@ public class Dog extends Pet {
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public Dog(String name, String breed, Date born, DogSize size) {
public Dog(@Nonnull String name, @Nonnull String breed, @Nullable Date born, @Nullable DogSize size) {
super(name, born);
if (breed == null) {
throw new IllegalArgumentException("Required value for 'breed' is null");
Expand All @@ -58,7 +63,7 @@ public Dog(String name, String breed, Date born, DogSize size) {
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public Dog(String name, String breed) {
public Dog(@Nonnull String name, @Nonnull String breed) {
this(name, breed, null, null);
}

Expand All @@ -67,7 +72,7 @@ public Dog(String name, String breed) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
@Nonnull
public String getName() {
return name;
}
Expand All @@ -76,7 +81,7 @@ public String getName() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
@Nonnull
public String getBreed() {
return breed;
}
Expand All @@ -85,7 +90,7 @@ public String getBreed() {
*
* @return value for this field, or {@code null} if not present.
*/
@javax.annotation.Nullable
@Nullable
public Date getBorn() {
return born;
}
Expand All @@ -94,7 +99,7 @@ public Date getBorn() {
*
* @return value for this field, or {@code null} if not present.
*/
@javax.annotation.Nullable
@Nullable
public DogSize getSize() {
return size;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
import java.util.Arrays;
import java.util.Date;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class Fish extends Pet {
// struct test.Fish (test.stone)

@Nonnull
protected final String species;
@Nonnull
protected final TankSize tankSize;

/**
Expand All @@ -35,7 +40,7 @@ public class Fish extends Pet {
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public Fish(String name, String species, TankSize tankSize, Date born) {
public Fish(@Nonnull String name, @Nonnull String species, @Nonnull TankSize tankSize, @Nullable Date born) {
super(name, born);
if (species == null) {
throw new IllegalArgumentException("Required value for 'species' is null");
Expand All @@ -61,7 +66,7 @@ public Fish(String name, String species, TankSize tankSize, Date born) {
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public Fish(String name, String species, TankSize tankSize) {
public Fish(@Nonnull String name, @Nonnull String species, @Nonnull TankSize tankSize) {
this(name, species, tankSize, null);
}

Expand All @@ -70,7 +75,7 @@ public Fish(String name, String species, TankSize tankSize) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
@Nonnull
public String getName() {
return name;
}
Expand All @@ -79,7 +84,7 @@ public String getName() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
@Nonnull
public String getSpecies() {
return species;
}
Expand All @@ -88,7 +93,7 @@ public String getSpecies() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
@Nonnull
public TankSize getTankSize() {
return tankSize;
}
Expand All @@ -97,7 +102,7 @@ public TankSize getTankSize() {
*
* @return value for this field, or {@code null} if not present.
*/
@javax.annotation.Nullable
@Nullable
public Date getBorn() {
return born;
}
Expand Down
Loading

0 comments on commit 91fe565

Please sign in to comment.