Skip to content

Commit

Permalink
[fix] build folder issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenrong274 committed Mar 3, 2021
1 parent 535c6bc commit 5cb890c
Show file tree
Hide file tree
Showing 11 changed files with 301 additions and 259 deletions.
17 changes: 10 additions & 7 deletions Assets/JenkinsBuild/AndroidKeyStore.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using UnityEngine;

[CreateAssetMenu(fileName = "AndroidKeyStore", menuName = "JenkinsBuild/Creat AndroidKeyStore", order = 1)]
public class AndroidKeyStore : ScriptableObject
namespace JenkinsBuild
{
public string KeystoreName;
public string KeystorePassword;
public string AliasName;
public string AliasPassword;
}
[CreateAssetMenu(fileName = "AndroidKeyStore", menuName = "JenkinsBuild/Creat AndroidKeyStore", order = 1)]
public class AndroidKeyStore : ScriptableObject
{
public string KeystoreName;
public string KeystorePassword;
public string AliasName;
public string AliasPassword;
}
}
120 changes: 61 additions & 59 deletions Assets/JenkinsBuild/Editor/AndroidKeyStoreEditor.cs
Original file line number Diff line number Diff line change
@@ -1,74 +1,76 @@
using System.IO;
using UnityEditor;
using UnityEditor;
using UnityEngine;

[CustomEditor(typeof(AndroidKeyStore))]
public class AndroidKeyStoreEditor : Editor
namespace JenkinsBuild
{
private float labelWidth = 125f;
private AndroidKeyStore m_Target;

private void OnEnable()
[CustomEditor(typeof(AndroidKeyStore))]
public class AndroidKeyStoreEditor : Editor
{
m_Target = (AndroidKeyStore)target;
}
private float labelWidth = 125f;
private AndroidKeyStore m_Target;

public override void OnInspectorGUI()
{
SetKeyStorePath();
SetKeyStorePassword();
SetAliasName();
SetAliasPassword();
SaveAsset();
}
private void OnEnable()
{
m_Target = (AndroidKeyStore)target;
}

private void SaveAsset()
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Save"))
public override void OnInspectorGUI()
{
EditorUtility.SetDirty(m_Target);
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
SetKeyStorePath();
SetKeyStorePassword();
SetAliasName();
SetAliasPassword();
SaveAsset();
}
GUILayout.EndHorizontal();
}

private void SetAliasPassword()
{
GUILayout.BeginHorizontal();
GUILayout.Label("Alias Password:", GUILayout.Width(labelWidth));
m_Target.AliasPassword = GUILayout.TextField(m_Target.AliasPassword);
GUILayout.EndHorizontal();
}
private void SaveAsset()
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Save"))
{
EditorUtility.SetDirty(m_Target);
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
GUILayout.EndHorizontal();
}

private void SetAliasName()
{
GUILayout.BeginHorizontal();
GUILayout.Label("Alias Name:", GUILayout.Width(labelWidth));
m_Target.AliasName = GUILayout.TextField(m_Target.AliasName);
GUILayout.EndHorizontal();
}
private void SetAliasPassword()
{
GUILayout.BeginHorizontal();
GUILayout.Label("Alias Password:", GUILayout.Width(labelWidth));
m_Target.AliasPassword = GUILayout.TextField(m_Target.AliasPassword);
GUILayout.EndHorizontal();
}

private void SetKeyStorePassword()
{
GUILayout.BeginHorizontal();
GUILayout.Label("Keystore Password:", GUILayout.Width(labelWidth));
m_Target.KeystorePassword = GUILayout.TextField(m_Target.KeystorePassword);
GUILayout.EndHorizontal();
}
private void SetAliasName()
{
GUILayout.BeginHorizontal();
GUILayout.Label("Alias Name:", GUILayout.Width(labelWidth));
m_Target.AliasName = GUILayout.TextField(m_Target.AliasName);
GUILayout.EndHorizontal();
}

private void SetKeyStorePath()
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Select keystore", GUILayout.Width(labelWidth)))
m_Target.KeystoreName = EditorUtility.OpenFilePanel("Select Keystore", Application.streamingAssetsPath, "keystore");
private void SetKeyStorePassword()
{
GUILayout.BeginHorizontal();
GUILayout.Label("Keystore Password:", GUILayout.Width(labelWidth));
m_Target.KeystorePassword = GUILayout.TextField(m_Target.KeystorePassword);
GUILayout.EndHorizontal();
}

GUILayout.EndHorizontal();
private void SetKeyStorePath()
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Select keystore", GUILayout.Width(labelWidth)))
m_Target.KeystoreName = EditorUtility.OpenFilePanel("Select Keystore", Application.streamingAssetsPath, "keystore");

GUILayout.EndHorizontal();

GUILayout.BeginHorizontal();
GUILayout.Label("Path:", GUILayout.Width(labelWidth));
GUILayout.Label(m_Target.KeystoreName);
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Label("Path:", GUILayout.Width(labelWidth));
GUILayout.Label(m_Target.KeystoreName);
GUILayout.EndHorizontal();
}
}
}
}
Loading

0 comments on commit 5cb890c

Please sign in to comment.