Skip to content

Commit

Permalink
Moves class definition in the same file of class implementation tryin…
Browse files Browse the repository at this point in the history
…g to avoid the AllPackageClasses.cs
  • Loading branch information
masesdevelopers committed Aug 30, 2024
1 parent bb430dd commit a3ab3a6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
11 changes: 7 additions & 4 deletions src/net/JNetReflector/InternalMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,15 @@ static void AnalyzeSubItems(string package, IDictionary<string, IDictionary<stri
.Replace(AllPackageClasses.NAMESPACE, package)
.Replace(AllPackageClasses.CLASSES, sb.ToString());

WriteFile(path, itemPackage);
//WriteFile(path, itemPackage);
_allPackages.Add(path, itemPackage);
}
else
{
var packageContent = File.ReadAllText(path);
var itemPackage = packageContent.Replace(AllPackageClasses.CLASSES, sb.ToString());

WriteFile(path, itemPackage);
//WriteFile(path, itemPackage);
_allPackages[path] = itemPackage;
}
}
Expand All @@ -355,7 +355,7 @@ static void AnalyzeSubItems(string package, IDictionary<string, IDictionary<stri
.Replace(AllPackageClasses.NAMESPACE, package)
.Replace(AllPackageClasses.CLASSES, sb.ToString());

WriteFile(path, itemPackage);
//WriteFile(path, itemPackage);
}
}

Expand Down Expand Up @@ -493,7 +493,10 @@ static string AnalyzeClasses(string jarOrModuleName, IEnumerable<Class> classDef
allClassBlock.Append(classGenericBlock);
}

var singleFileBlockStr = singleFileBlock.ToString();
allClassBlock.AppendLine();
allClassBlock.AppendLine();
allClassBlock.Append(singleFileBlock.ToString());
var singleFileBlockStr = allClassBlock.ToString();
if (!string.IsNullOrWhiteSpace(singleFileBlockStr))
{
var singleClassFileTemplate = Template.GetTemplate(Template.SingleClassFileTemplate);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER definition
ALLPACKAGE_CLASSES_STUB_CLASS_DECORATION_PLACEHOLDER
public partial class ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER : ALLPACKAGE_CLASSES_STUB_BASECLASS_PLACEHOLDERALLPACKAGE_CLASSES_STUB_WHERECLAUSES_PLACEHOLDER
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER definition
ALLPACKAGE_CLASSES_STUB_CLASS_DECORATION_PLACEHOLDER
public partial class ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER : ALLPACKAGE_CLASSES_STUB_BASECLASS_PLACEHOLDERALLPACKAGE_CLASSES_STUB_WHERECLAUSES_PLACEHOLDER
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER definition
ALLPACKAGE_CLASSES_STUB_CLASS_DECORATION_PLACEHOLDER
public partial class ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER : ALLPACKAGE_CLASSES_STUB_BASECLASS_PLACEHOLDER
{
Expand All @@ -14,7 +14,7 @@ ALLPACKAGE_CLASSES_STUB_LISTENER_CLASS_PLACEHOLDER
}
#endregion

#region ALLPACKAGE_CLASSES_STUB_CLASS_DIRECT_PLACEHOLDER
#region ALLPACKAGE_CLASSES_STUB_CLASS_DIRECT_PLACEHOLDER definition
/// <summary>
/// Direct override of <see cref="ALLPACKAGE_CLASSES_STUB_SIMPLECLASS_PLACEHOLDER"/> or its generic type if there is one
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER definition
/// <summary>
/// ALLPACKAGE_CLASSES_STUB_CLASS_HELP_PLACEHOLDER
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER
#region ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER definition
ALLPACKAGE_CLASSES_STUB_CLASS_DECORATION_PLACEHOLDER
public partial class ALLPACKAGE_CLASSES_STUB_CLASS_PLACEHOLDER : ALLPACKAGE_CLASSES_STUB_BASECLASS_PLACEHOLDER
{
Expand Down

0 comments on commit a3ab3a6

Please sign in to comment.