Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
majenkotech committed Aug 23, 2015
0 parents commit 89e3376
Show file tree
Hide file tree
Showing 10 changed files with 1,813 additions and 0 deletions.
36 changes: 36 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<project name="UECIDE Core" default="build">

<target name="clean" description="Clean out the build directories">
<delete dir="bin" />
</target>

<target name="compile" description="Compile">
<mkdir dir="bin" />
<javac target="1.7"
debug="true"
debuglevel="lines,vars,source"
deprecation="true"
source="1.7"
encoding="UTF-8"
bootclasspath="${bootclass.path}"
includeAntRuntime="false"
srcdir="src"
destdir="bin">
<compilerarg value="-Xlint:unchecked"/>
</javac>
</target>

<target name="build" depends="compile" description="Build">
<jar basedir="bin" destfile="RepoBuilder.jar">
<fileset dir="bin" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="org.uecide.RepoBuilder" />
<attribute name="Class-Path" value="RepoBuilder.jar" />
</manifest>
</jar>
<chmod perm="0755" file="RepoBuilder.jar" />
</target>

</project>
57 changes: 57 additions & 0 deletions src/org/uecide/Board.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package org.uecide;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.table.*;
import java.util.*;
import java.io.*;
import java.net.*;

class Board extends Package {

public Board(File r, String name) {
super(r, name);
}

public String getBlock() {
StringBuilder sb = new StringBuilder();

sb.append("Package: " + packagename + "\n");
sb.append("Section: boards\n");
sb.append("Architecture: all\n");

sb.append(getEntry("XBSC-Group"));
sb.append(getEntry("XBSC-Subroup"));
sb.append(getEntry("XBSC-Image"));
sb.append(getEntry("Depends"));
sb.append(getEntry("Recommends"));
sb.append(getEntry("Homepage"));
sb.append(getEntry("Description"));

return sb.toString();
}

public void populatePanel(final JPanel p) {
p.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridwidth = 1;
c.gridheight = 1;
c.gridx = 0;
c.gridy = 0;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1.0;


addCodename(p, c, "Board Codename:");
addDescriptionPair(p, c, "Board Name:");

addEntry(p, c, "Group", "XBSC-Group");
addEntry(p, c, "Subgroup", "XBSC-Subgroup");
addEntry(p, c, "Depends", "Depends");
addEntry(p, c, "Recommends", "Recommends");

addFileTable(p, c);

}
}
33 changes: 33 additions & 0 deletions src/org/uecide/Compiler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.uecide;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.table.*;
import java.util.*;
import java.io.*;
import java.net.*;

class Compiler extends Package {
public Compiler(File r, String name) {
super(r,name);
}

public String getBlock() {
StringBuilder sb = new StringBuilder();

sb.append("Package: " + packagename + "\n");
sb.append("Section: compilers\n");
sb.append("Architecture: any\n");

sb.append(getEntry("XBSC-Group"));
sb.append(getEntry("XBSC-Subroup"));
sb.append(getEntry("XBSC-Image"));
sb.append(getEntry("Depends"));
sb.append(getEntry("Recommends"));
sb.append(getEntry("Homepage"));
sb.append(getEntry("Description"));

return sb.toString();
}
}
84 changes: 84 additions & 0 deletions src/org/uecide/Core.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package org.uecide;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.table.*;
import java.util.*;
import java.io.*;
import java.net.*;

class Core extends Package {
JTextField recommendBox;

public Core(File r, String name) {
super(r, name);
}

public String getBlock() {
StringBuilder sb = new StringBuilder();

sb.append("Package: " + packagename + "\n");
sb.append("Section: cores\n");
sb.append("Architecture: all\n");

sb.append(getEntry("XBSC-Group"));
sb.append(getEntry("XBSC-Subroup"));
sb.append(getEntry("XBSC-Image"));
sb.append(getEntry("Depends"));
sb.append(getEntry("Recommends"));
sb.append(getEntry("Homepage"));
sb.append(getEntry("Description"));

return sb.toString();
}

public void populatePanel(final JPanel p) {
p.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridwidth = 1;
c.gridheight = 1;
c.gridx = 0;
c.gridy = 0;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1.0;


addCodename(p, c, "Core Codename:");
addDescriptionPair(p, c, "Core Name:");

addEntry(p, c, "Group", "XBSC-Group");
addEntry(p, c, "Subgroup", "XBSC-Subgroup");
addEntry(p, c, "Depends", "Depends");
recommendBox = addEntry(p, c, "Recommends", "Recommends");
c.gridx = 1;
JButton addLibs = new JButton("Add all libraries");
addLibs.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
doAddAllLibs();
}
});
p.add(addLibs, c);
c.gridx = 0;
c.gridy++;

addFileTable(p, c);

}

public void doAddAllLibs() {
String liblist = "";
for (Package p : RepoBuilder.repo.getPackages()) {
if (p instanceof Library) {
if (!liblist.equals("")) {
liblist += ", ";
}
liblist += p.toString();
}
}
set("Recommends", liblist);
recommendBox.setText(liblist);

}

}
110 changes: 110 additions & 0 deletions src/org/uecide/Library.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package org.uecide;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.table.*;
import java.util.*;
import java.io.*;
import java.net.*;

class Library extends Package {
public Library(File r, String name) {
super(r, name);
}

public String getBlock() {
StringBuilder sb = new StringBuilder();

sb.append("Package: " + packagename + "\n");
sb.append("Section: libraries\n");
sb.append("Architecture: all\n");

sb.append(getEntry("XBSC-Group"));
sb.append(getEntry("XBSC-Subgroup"));
sb.append(getEntry("XBSC-Image"));
sb.append(getEntry("Depends"));
sb.append(getEntry("Recommends"));
sb.append(getEntry("Provides"));
sb.append(getEntry("Homepage"));
sb.append(getEntry("Description"));

return sb.toString();
}

public void populatePanel(final JPanel p) {
p.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridwidth = 1;
c.gridheight = 1;
c.gridx = 0;
c.gridy = 0;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1.0;


addCodename(p, c, "Library Codename:");
addDescriptionPair(p, c, "Library Name:");

Object[] groupKeys = RepoBuilder.libs.keySet().toArray();
JLabel groupLab = new JLabel("Group:");
final JComboBox groupBox = new JComboBox(groupKeys);
groupBox.setSelectedItem(get("XBSC-Group"));
c.gridx = 0;
p.add(groupLab, c);
c.gridx = 1;
p.add(groupBox, c);
c.gridx = 0;
c.gridy++;

String g = get("XBSC-Group");
if (g == null) {
Object[] obs = RepoBuilder.libs.keySet().toArray();
g = (String)obs[0];
}
Object[] subgroupKeys;
ArrayList<String>sgl = RepoBuilder.libs.get(g);
if (sgl != null) {
subgroupKeys = sgl.toArray();
} else {
subgroupKeys = new String[0];
}

JLabel subgroupLab = new JLabel("Subgroup:");
final JComboBox subgroupBox = new JComboBox(subgroupKeys);
subgroupBox.setSelectedItem(get("XBSC-Subgroup"));
c.gridx = 0;
p.add(subgroupLab, c);
c.gridx = 1;
p.add(subgroupBox, c);
c.gridx = 0;
c.gridy++;

groupBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Library.this.set("XBSC-Group", (String)groupBox.getSelectedItem());
Object[] subgroupKeys = RepoBuilder.libs.get(groupBox.getSelectedItem()).toArray();

subgroupBox.removeAllItems();
for (Object o : subgroupKeys) {
subgroupBox.addItem(o);
}
subgroupBox.setSelectedItem(get("XBSC-Subgroup"));
}
});

subgroupBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Library.this.set("XBSC-Subgroup", (String)subgroupBox.getSelectedItem());
}
});

addEntry(p, c, "Provides", "Provides");
addEntry(p, c, "Depends", "Depends");
addEntry(p, c, "Recommends", "Recommends");

addFileTable(p, c);

}

}
Loading

0 comments on commit 89e3376

Please sign in to comment.